/* ============================================================
   LN Service – Main Styles v3 (Redesign)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #0a0a0c;
    --bg2:        #111115;
    --bg3:        #18181d;
    --bg4:        #202028;
    --border:     #252530;
    --border2:    #32323f;
    --text:       #eaeaf0;
    --text-muted: #6a6a7a;
    --text-dim:   #4a4a5a;
    --accent:     #5865f2;
    --accent-h:   #4752c4;
    --accent-glow:rgba(88,101,242,.25);
    --cyan:       #4db8ff;
    --radius:     10px;
    --radius-lg:  16px;
    --font-head:  'Rajdhani', sans-serif;
    --font-body:  'Inter', sans-serif;
    --shadow:     0 4px 24px rgba(0,0,0,.5);
}

html, body { height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; text-decoration: none; }

/* ── Announcement Bar ─────────────────────────────────────── */
.announcement-bar {
    background: linear-gradient(90deg,#12122a,#161630);
    border-bottom: 1px solid #2a2a50;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .82rem;
    color: #8888cc;
}
.ann-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #5555aa;
    cursor: pointer;
    font-size: .9rem;
    padding: 0 4px;
    transition: color .2s;
    line-height: 1;
}
.ann-close:hover { color: #9999ff; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo-link   { display: flex; align-items: center; gap: 8px; }
.logo-text   { display: flex; flex-direction: column; line-height: 1.1; }
.logo-papa   { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--cyan); letter-spacing: 3px; }
.logo-mod    { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: 2px; }
.logo-bolt   { color: var(--cyan); }
.topbar-subtitle {
    color: var(--text-dim);
    font-size: .75rem;
    border-left: 1px solid var(--border);
    padding-left: 14px;
    letter-spacing: .3px;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }

.nav-icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px; height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    transition: border-color .2s, color .2s, background .2s;
}
.nav-icon-btn:hover { border-color: var(--border2); color: var(--text); background: var(--bg3); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
}
.nav-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    transition: border-color .2s;
}
.nav-avatar:hover { border-color: var(--accent); }
.nav-username { font-weight: 600; font-size: .85rem; }

.btn-logout {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 7px;
    font-size: .8rem;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.btn-logout:hover { border-color: var(--border2); color: var(--text); }

/* ── Page Layout ──────────────────────────────────────────── */
.page-wrap { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 8px;
    overflow-y: auto;
}
.sidebar-section-title {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    padding: 4px 6px;
}
.btn-new-ticket {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-new-ticket:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 4px 18px var(--accent-glow); }

.sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 12px;
    color: var(--text-dim);
    font-size: .82rem;
    text-align: center;
}
.sidebar-empty .icon { font-size: 2rem; opacity: .3; }

.ticket-item {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    text-decoration: none;
    display: block;
}
.ticket-item:hover { border-color: var(--border2); background: var(--bg3); }
.ticket-item.active { border-color: var(--accent); background: #12123a; }
.ticket-item-num   { font-size: .68rem; color: var(--text-dim); font-family: monospace; margin-bottom: 3px; }
.ticket-item-title { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-item-meta  { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: .72rem; }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}
.welcome-state {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
}
.welcome-state .big-icon { font-size: 3.5rem; opacity: .2; }
.welcome-state h2 { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--text); letter-spacing: 1px; }

/* ── Ticket Detail ────────────────────────────────────────── */
.ticket-detail { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.ticket-detail-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
}
.ticket-detail-header h2 { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; letter-spacing: .4px; }
.ticket-detail-meta { display: flex; gap: 12px; margin-top: 6px; font-size: .76rem; color: var(--text-muted); flex-wrap: wrap; align-items: center; }

/* ── Messages ─────────────────────────────────────────────── */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.message-bubble { display: flex; gap: 10px; max-width: 78%; }
.message-bubble.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.msg-author { font-size: .72rem; color: var(--text-muted); margin-bottom: 3px; }
.msg-text {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 13px;
    font-size: .85rem;
    line-height: 1.55;
    white-space: pre-wrap;
}
.message-bubble.mine  .msg-text { background: #14143a; border-color: #2a2a5a; }
.message-bubble.staff .msg-text { background: #0f2a1a; border-color: #1a4a2a; }

.msg-input-area {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    background: var(--bg2);
}
.msg-input-area textarea {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: .85rem;
    padding: 9px 13px;
    resize: none;
    outline: none;
    transition: border-color .2s;
    height: 72px;
}
.msg-input-area textarea:focus { border-color: var(--accent); }
.btn-send {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: background .2s;
    align-self: flex-end;
    white-space: nowrap;
}
.btn-send:hover { background: var(--accent-h); }

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 40%, #0f0f2a 0%, #0a0a0c 65%);
}
.login-card {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    padding: 44px 36px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,.7), 0 0 0 1px #ffffff06;
}
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; gap: 2px; }
.login-logo .logo-papa { font-size: 1.8rem; }
.login-logo .logo-mod  { font-size: 1.8rem; }
.login-card h1 { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; letter-spacing: .8px; }
.login-card p  { color: var(--text-muted); font-size: .85rem; line-height: 1.65; margin-bottom: 24px; }
.btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 13px 26px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 20px var(--accent-glow);
    width: 100%;
    justify-content: center;
}
.btn-discord:hover { background: var(--accent-h); transform: translateY(-2px); box-shadow: 0 6px 28px rgba(88,101,242,.45); }
.discord-icon { width: 20px; height: 20px; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: var(--text-dim);
}
footer a { transition: color .2s; }
footer a:hover { color: var(--text-muted); }
.footer-copy { opacity: .4; margin-left: 10px; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    transform: scale(.96) translateY(8px);
    transition: transform .2s;
    box-shadow: var(--shadow);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h2 { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; letter-spacing: .4px; }
.modal-close {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 30px; height: 30px;
    border-radius: 7px;
    cursor: pointer;
    font-size: .9rem;
    transition: all .2s;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { border-color: #e05252; color: #e05252; }

/* Category grid */
.category-label { font-size: .72rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 14px;
    cursor: pointer;
    transition: border-color .2s, background .15s, transform .15s;
    text-align: center;
}
.cat-card:hover { transform: translateY(-2px); background: var(--bg4); }
.cat-card .cat-icon  { font-size: 1.7rem; margin-bottom: 7px; }
.cat-card .cat-name  { font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.cat-card .cat-desc  { font-size: .74rem; color: var(--text-muted); line-height: 1.4; }
.cat-card.disabled   { opacity: .45; cursor: not-allowed; }
.cat-card.disabled:hover { transform: none; }

/* Forms */
.ticket-form { display: flex; flex-direction: column; gap: 14px; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.form-group input,
.form-group textarea,
.form-group select {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: .87rem;
    padding: 9px 12px;
    outline: none;
    transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.btn-back {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 7px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: .85rem;
    transition: all .2s;
}
.btn-back:hover { border-color: var(--border2); color: var(--text); }
.btn-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: background .2s;
}
.btn-submit:hover { background: var(--accent-h); }

/* Alert */
.alert { border-radius: 7px; padding: 10px 14px; font-size: .84rem; margin-bottom: 14px; }
.alert-error   { background: #2a1212; border: 1px solid #5a1a1a; color: #f87171; }
.alert-success { background: #0f2a18; border: 1px solid #1a5a2a; color: #86efac; }

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Attachments ──────────────────────────────────────────── */
.attach-wrap {
    margin-top: 7px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 280px;
}
.attach-img-link { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.attach-img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    background: var(--bg);
    cursor: zoom-in;
    transition: opacity .2s;
}
.attach-img:hover { opacity: .9; }
.attach-meta { font-size: .7rem; color: var(--text-dim); }

.attach-file { margin-top: 6px; max-width: 260px; }
.attach-file-link {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .2s, background .2s;
}
.attach-file-link:hover { border-color: var(--accent); background: var(--bg4); }
.attach-icon      { font-size: 1.4rem; flex-shrink: 0; }
.attach-file-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.attach-name      { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-size      { font-size: .7rem; color: var(--text-dim); }
.attach-dl        { color: var(--text-muted); font-size: .9rem; flex-shrink: 0; }

/* ── Enhanced input area with file upload ─────────────────── */
.msg-input-wrap { display: flex; flex-direction: column; gap: 0; background: var(--bg2); border-top: 1px solid var(--border); }
.file-preview-strip {
    display: none;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 24px 0;
}
.file-preview-strip.has-files { display: flex; }
.file-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px 3px 8px;
    font-size: .75rem;
    color: var(--text-muted);
    max-width: 200px;
}
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-rm {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    font-size: .8rem; padding: 0; line-height: 1; flex-shrink: 0;
}
.file-chip-rm:hover { color: #e05252; }

.msg-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 24px 14px;
}
.msg-input-area textarea {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: .85rem;
    padding: 9px 12px;
    resize: none;
    outline: none;
    transition: border-color .2s;
    height: 68px;
}
.msg-input-area textarea:focus { border-color: var(--accent); }

.btn-upload {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    width: 38px; height: 38px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}
.btn-upload:hover { border-color: var(--accent); color: var(--text); background: var(--bg4); }
.btn-upload.has-file { border-color: #3dba7b; color: #3dba7b; background: #0a2018; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; object-fit: contain; }
