/* ═══════════════════════════════════════════
   Support Ticket System Styles
   ═══════════════════════════════════════════ */

/* ── Navbar Dropdown ── */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    background: #111827; border: 1px solid rgba(212,175,55,0.15); border-radius: 12px;
    padding: 8px 0; min-width: 200px; box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    z-index: 1000; list-style: none; margin: 0; padding-top: 18px;
}
/* Arrow pointer */
.nav-dropdown-menu::before {
    content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%) rotate(45deg);
    width: 12px; height: 12px; background: #111827; border-left: 1px solid rgba(212,175,55,0.15);
    border-top: 1px solid rgba(212,175,55,0.15);
}
/* Invisible bridge to prevent hover gap */
.nav-dropdown::after {
    content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 15px;
    display: none;
}
.nav-dropdown:hover::after { display: block; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.nav-dropdown-menu li a {
    display: flex; align-items: center; gap: 10px; padding: 10px 18px;
    color: rgba(255,255,255,0.7); font-size: 0.85rem; white-space: nowrap;
    transition: all 0.15s; text-decoration: none;
}
.nav-dropdown-menu li a:hover { background: rgba(212,175,55,0.08); color: #d4af37; }
.nav-dropdown-menu li a i { width: 16px; text-align: center; color: #d4af37; font-size: 0.8rem; }

/* ── Modal Overlay ── */
.support-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; z-index: 10000;
    animation: supportFadeIn 0.25s ease;
}
@keyframes supportFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes supportSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.support-modal {
    background: #111827; border: 1px solid rgba(212,175,55,0.15); border-radius: 20px;
    width: 520px; max-width: 94vw; max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5); animation: supportSlideUp 0.3s ease;
    overflow: hidden;
}
.support-modal-lg { width: 640px; }
.support-modal-sm { width: 420px; }

.support-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.support-modal-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.05rem; font-weight: 700; color: #d4af37;
}
.support-modal-title i { font-size: 1rem; }
.support-modal-close {
    background: none; border: none; color: rgba(255,255,255,0.4); font-size: 1.5rem;
    cursor: pointer; width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.support-modal-close:hover { background: rgba(255,255,255,0.06); color: white; }

.support-modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.support-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Form Fields ── */
.support-field { margin-bottom: 18px; }
.support-field label {
    display: block; font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
}
.support-field label .required { color: #ef4444; }
.support-field input[type="text"],
.support-field textarea,
.support-field select {
    width: 100%; padding: 12px 16px; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
    color: rgba(255,255,255,0.85); font-size: 0.88rem; outline: none;
    transition: border-color 0.2s; font-family: inherit;
}
.support-field input:focus, .support-field textarea:focus, .support-field select:focus {
    border-color: rgba(212,175,55,0.4);
}
.support-field textarea { resize: vertical; min-height: 100px; }
.support-field select { cursor: pointer; }
.support-field select option { background: #111827; }

/* ── File Upload ── */
.support-file-upload {
    position: relative; border: 2px dashed rgba(212,175,55,0.15); border-radius: 12px;
    padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.support-file-upload:hover { border-color: rgba(212,175,55,0.4); background: rgba(212,175,55,0.02); }
.support-file-upload input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.support-file-label i { font-size: 1.5rem; color: #d4af37; margin-bottom: 6px; display: block; }
.support-file-label span { color: rgba(255,255,255,0.6); font-size: 0.85rem; display: block; }
.support-file-label small { color: rgba(255,255,255,0.3); font-size: 0.72rem; display: block; margin-top: 4px; }
.support-file-name {
    margin-top: 8px; padding: 8px 12px; background: rgba(212,175,55,0.06);
    border-radius: 8px; font-size: 0.78rem; color: #d4af37;
    display: flex; align-items: center; gap: 6px;
}

/* ── Buttons ── */
.support-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
    border-radius: 12px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; border: none; font-family: inherit;
}
.support-btn-primary {
    background: linear-gradient(135deg, #d4af37, #f5d060); color: #0a0e1a;
}
.support-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(212,175,55,0.3); }
.support-btn-secondary {
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.08);
}
.support-btn-secondary:hover { background: rgba(255,255,255,0.1); color: white; }
.support-btn-full { width: 100%; justify-content: center; }
.support-btn-sm { padding: 6px 14px; font-size: 0.78rem; border-radius: 8px; margin-bottom: 16px; }
.support-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Alert ── */
.support-alert {
    padding: 12px 16px; border-radius: 10px; font-size: 0.82rem; margin-top: 12px;
}
.support-alert.success { background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.support-alert.error { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* ── Divider ── */
.support-divider {
    display: flex; align-items: center; margin: 24px 0 16px; gap: 10px;
}
.support-divider::before, .support-divider::after {
    content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.06);
}
.support-divider span { color: rgba(255,255,255,0.3); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* ── My Tickets List ── */
.my-tickets-list { max-height: 250px; overflow-y: auto; }
.ticket-list-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-radius: 10px; cursor: pointer; transition: all 0.15s;
    border: 1px solid transparent; margin-bottom: 6px;
}
.ticket-list-item:hover { background: rgba(212,175,55,0.04); border-color: rgba(212,175,55,0.1); }
.ticket-list-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ticket-list-number { font-size: 0.72rem; color: #d4af37; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.ticket-list-subject { font-size: 0.82rem; color: rgba(255,255,255,0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-list-date { font-size: 0.68rem; color: rgba(255,255,255,0.3); }
.ticket-status-badge {
    padding: 4px 10px; border-radius: 20px; font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0;
}
.badge-open { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-in_progress { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-resolved { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-closed { background: rgba(107,114,128,0.15); color: #6b7280; }

/* ── Status Stepper ── */
.ticket-status-stepper {
    display: flex; align-items: center; justify-content: center; gap: 0;
    margin: 20px 0; padding: 16px;
}
.stepper-step {
    display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; min-width: 80px;
}
.stepper-circle {
    width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.3); transition: all 0.3s;
}
.stepper-step.active .stepper-circle {
    background: linear-gradient(135deg, #d4af37, #f5d060); color: #0a0e1a;
    border-color: #d4af37; box-shadow: 0 0 15px rgba(212,175,55,0.3);
}
.stepper-step.done .stepper-circle {
    background: rgba(34,197,94,0.15); color: #22c55e; border-color: #22c55e;
}
.stepper-label { font-size: 0.68rem; color: rgba(255,255,255,0.3); text-align: center; }
.stepper-step.active .stepper-label, .stepper-step.done .stepper-label { color: rgba(255,255,255,0.7); }
.stepper-line { flex: 1; height: 2px; background: rgba(255,255,255,0.06); min-width: 30px; margin-top: -18px; }
.stepper-line.done { background: #22c55e; }
.stepper-line.active { background: linear-gradient(90deg, #22c55e, #d4af37); }

/* ── Ticket Info Card ── */
.ticket-info-card {
    background: rgba(212,175,55,0.04); border: 1px solid rgba(212,175,55,0.1);
    border-radius: 14px; padding: 16px 20px; margin-bottom: 20px;
}
.ticket-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.ticket-info-row:last-child { border-bottom: none; }
.ticket-info-label { font-size: 0.75rem; color: rgba(255,255,255,0.4); font-weight: 600; }
.ticket-info-value { font-size: 0.8rem; color: rgba(255,255,255,0.8); }

/* ── Conversation Thread ── */
.ticket-thread { margin-bottom: 20px; }
.thread-msg {
    display: flex; gap: 12px; margin-bottom: 14px; animation: supportFadeIn 0.2s ease;
}
.thread-msg.admin { flex-direction: row-reverse; }
.thread-avatar {
    width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.thread-msg:not(.admin) .thread-avatar { background: rgba(59,130,246,0.15); color: #3b82f6; }
.thread-msg.admin .thread-avatar { background: rgba(212,175,55,0.15); color: #d4af37; }
.thread-bubble {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 12px 16px; max-width: 75%; min-width: 200px;
}
.thread-msg.admin .thread-bubble {
    background: rgba(212,175,55,0.04); border-color: rgba(212,175,55,0.1);
}
.thread-name { font-size: 0.72rem; font-weight: 700; margin-bottom: 4px; }
.thread-msg:not(.admin) .thread-name { color: #3b82f6; }
.thread-msg.admin .thread-name { color: #d4af37; }
.thread-text { font-size: 0.82rem; color: rgba(255,255,255,0.7); line-height: 1.5; white-space: pre-wrap; }
.thread-time { font-size: 0.65rem; color: rgba(255,255,255,0.25); margin-top: 6px; }
.thread-attachment {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
    padding: 6px 12px; background: rgba(212,175,55,0.06); border-radius: 8px;
    color: #d4af37; font-size: 0.75rem; text-decoration: none;
}
.thread-attachment:hover { background: rgba(212,175,55,0.12); }

/* ── Reply Form ── */
.ticket-reply-form {
    border-top: 1px solid rgba(255,255,255,0.06); padding-top: 16px;
}

/* ── Success Modal ── */
.success-icon { font-size: 3rem; color: #22c55e; margin-bottom: 16px; }
.success-icon i { animation: successPop 0.5s ease; }
@keyframes successPop { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.ticket-number-display {
    font-family: 'JetBrains Mono', monospace; font-size: 1.3rem; font-weight: 800;
    color: #d4af37; margin: 10px 0; letter-spacing: 2px;
}
.support-note { font-size: 0.8rem; color: rgba(255,255,255,0.4); margin-bottom: 20px; }

/* ── Loading ── */
.support-loading { text-align: center; padding: 20px; color: rgba(255,255,255,0.4); font-size: 0.82rem; }
.support-empty { text-align: center; padding: 30px; color: rgba(255,255,255,0.3); font-size: 0.82rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    /* Modals */
    .support-modal,
    .support-modal-lg,
    .support-modal-sm {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    .support-modal-overlay {
        align-items: flex-end;
    }
    .support-modal-header {
        padding: 14px 16px;
    }
    .support-modal-title {
        font-size: 0.95rem;
    }
    .support-modal-body {
        padding: 16px;
    }
    .support-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }
    .support-modal-footer .support-btn {
        width: 100%;
        justify-content: center;
    }

    /* Form fields */
    .support-field input[type="text"],
    .support-field textarea,
    .support-field select {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    .support-field textarea {
        min-height: 80px;
    }
    .support-file-upload {
        padding: 16px 12px;
    }
    .support-file-label i {
        font-size: 1.2rem;
    }
    .support-file-label span {
        font-size: 0.8rem;
    }
    .support-file-label small {
        font-size: 0.68rem;
    }

    /* Stepper */
    .ticket-status-stepper {
        flex-wrap: wrap;
        gap: 0;
        padding: 12px 8px;
    }
    .stepper-step {
        min-width: 55px;
    }
    .stepper-circle {
        width: 30px;
        height: 30px;
        font-size: 0.65rem;
    }
    .stepper-label {
        font-size: 0.6rem;
    }
    .stepper-line {
        min-width: 12px;
    }

    /* Info card */
    .ticket-info-card {
        padding: 12px 14px;
    }
    .ticket-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 6px 0;
    }
    .ticket-info-label {
        font-size: 0.7rem;
    }
    .ticket-info-value {
        font-size: 0.78rem;
    }

    /* Thread */
    .thread-bubble {
        max-width: 88%;
        min-width: 150px;
        padding: 10px 12px;
    }
    .thread-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }
    .thread-msg {
        gap: 8px;
    }
    .thread-text {
        font-size: 0.78rem;
    }
    .thread-name {
        font-size: 0.68rem;
    }
    .thread-time {
        font-size: 0.6rem;
    }
    .thread-attachment {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    /* Tickets list */
    .ticket-list-item {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .ticket-list-subject {
        font-size: 0.78rem;
    }
    .ticket-status-badge {
        font-size: 0.62rem;
        padding: 3px 8px;
    }

    /* Buttons */
    .support-btn {
        padding: 10px 16px;
        font-size: 0.82rem;
    }
    .support-btn-full {
        padding: 12px;
    }

    /* Success modal */
    .ticket-number-display {
        font-size: 1.1rem;
    }

    /* Navbar dropdown (mobile) */
    .nav-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        border-radius: 16px 16px 0 0;
        min-width: 100%;
        padding: 12px 0 24px;
    }
    .nav-dropdown-menu::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .support-modal-title {
        font-size: 0.88rem;
        gap: 6px;
    }
    .support-modal-title i {
        font-size: 0.85rem;
    }
    .stepper-step {
        min-width: 48px;
    }
    .stepper-circle {
        width: 26px;
        height: 26px;
        font-size: 0.6rem;
    }
    .stepper-label {
        font-size: 0.55rem;
    }
    .stepper-line {
        min-width: 8px;
    }
    .thread-bubble {
        max-width: 92%;
    }
    .ticket-list-item {
        padding: 8px 10px;
    }
}
