/* =============================================
   KUSTOM FX — Admin Portal Styles
   Reuses main site CSS variables
   ============================================= */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a2e;
    --bg-surface: #16161f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent-cyan: #00f0ff;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-orange: #f97316;
    --accent-green: #22c55e;
    --gradient-main: linear-gradient(135deg, #00f0ff, #a855f7);
    --gradient-hover: linear-gradient(135deg, #a855f7, #ec4899);
    --border: #2a2a3e;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(0, 240, 255, 0.15);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --sidebar-width: 240px;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================
   LOGIN PAGE
   ============================================= */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-dark);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
}

.login-brand {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.brand-k, .brand-f, .brand-x {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-hidden-wrap {
    display: inline-block;
    position: relative;
    overflow: visible;
}

.brand-hidden {
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 0.85em;
}

.brand-hidden-wrap::before,
.brand-hidden-wrap::after {
    content: '';
    position: absolute;
    top: -6px;
    bottom: -6px;
    width: 18px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    filter: blur(4px);
    opacity: 0;
}

.brand-hidden-wrap::before {
    background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.8) 0%, rgba(0, 240, 255, 0.35) 40%, transparent 70%);
    box-shadow: 0 0 12px 5px rgba(0, 240, 255, 0.5);
    animation: brandBeam 10s linear infinite;
}

.brand-hidden-wrap::after {
    background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.8) 0%, rgba(168, 85, 247, 0.35) 40%, transparent 70%);
    box-shadow: 0 0 12px 5px rgba(168, 85, 247, 0.5);
    animation: brandBeamR 10s linear infinite;
}

@keyframes brandBeam {
    0%, 2% { left: -15%; opacity: 0; } 3% { left: -10%; opacity: 1; } 35% { left: 110%; opacity: 1; } 37% { left: 115%; opacity: 0; } 37.1%, 100% { left: -15%; opacity: 0; }
}

@keyframes brandBeamR {
    0%, 52% { left: 115%; opacity: 0; } 53% { left: 110%; opacity: 1; } 85% { left: -10%; opacity: 1; } 87% { left: -15%; opacity: 0; } 87.1%, 100% { left: 115%; opacity: 0; }
}

.bh-u { animation: bSpotU 10s linear infinite; }
.bh-s { animation: bSpotS 10s linear infinite; }
.bh-t { animation: bSpotT 10s linear infinite; }
.bh-o { animation: bSpotO 10s linear infinite; }
.bh-m { animation: bSpotM 10s linear infinite; }

@keyframes bSpotU {
    0%, 6% { color: transparent; -webkit-text-fill-color: transparent; } 8% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 78% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 80% { color: #a855f7; -webkit-text-fill-color: #a855f7; } 84%, 100% { color: transparent; -webkit-text-fill-color: transparent; }
}
@keyframes bSpotS {
    0%, 12% { color: transparent; -webkit-text-fill-color: transparent; } 14% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 73% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 75% { color: #a855f7; -webkit-text-fill-color: #a855f7; } 79%, 100% { color: transparent; -webkit-text-fill-color: transparent; }
}
@keyframes bSpotT {
    0%, 17% { color: transparent; -webkit-text-fill-color: transparent; } 19% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 67% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 69% { color: #a855f7; -webkit-text-fill-color: #a855f7; } 73%, 100% { color: transparent; -webkit-text-fill-color: transparent; }
}
@keyframes bSpotO {
    0%, 23% { color: transparent; -webkit-text-fill-color: transparent; } 25% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 62% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 64% { color: #a855f7; -webkit-text-fill-color: #a855f7; } 68%, 100% { color: transparent; -webkit-text-fill-color: transparent; }
}
@keyframes bSpotM {
    0%, 28% { color: transparent; -webkit-text-fill-color: transparent; } 30% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 56% { color: #00f0ff; -webkit-text-fill-color: #00f0ff; } 58% { color: #a855f7; -webkit-text-fill-color: #a855f7; } 62%, 100% { color: transparent; -webkit-text-fill-color: transparent; }
}

.brand-k { animation: glowK 5s infinite; }
.brand-glow-f { animation: glowF 4s infinite; }
.brand-glow-x { animation: glowX 6s infinite; }

@keyframes glowK {
    0%, 100% { opacity: 1; } 20% { opacity: 0.6; } 22% { opacity: 1; } 23% { opacity: 0.7; } 25% { opacity: 1; } 70% { opacity: 1; } 71% { opacity: 0.5; } 73% { opacity: 1; } 74% { opacity: 0.65; } 75% { opacity: 1; }
}
@keyframes glowF {
    0%, 100% { opacity: 1; } 3% { opacity: 0.65; } 6% { opacity: 1; } 7% { opacity: 0.6; } 9% { opacity: 1; } 55% { opacity: 1; } 57% { opacity: 0.5; } 58% { opacity: 1; } 60% { opacity: 0.65; } 61% { opacity: 1; }
}
@keyframes glowX {
    0%, 100% { opacity: 1; } 12% { opacity: 0.7; } 14% { opacity: 1; } 40% { opacity: 1; } 42% { opacity: 0.6; } 43% { opacity: 1; } 44% { opacity: 0.5; } 46% { opacity: 1; } 83% { opacity: 1; } 84% { opacity: 0.65; } 86% { opacity: 1; }
}

.login-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 32px;
}

/* =============================================
   ALERTS
   ============================================= */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: left;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-warning {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: var(--accent-orange);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--accent-green);
}

/* =============================================
   FORM COMPONENTS
   ============================================= */

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b6b80' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--gradient-main);
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* =============================================
   ADMIN LAYOUT
   ============================================= */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    border-bottom: 1px solid var(--border);
}

.brand-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-left: 8px;
    vertical-align: middle;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan);
}

.nav-item.logout {
    color: var(--text-muted);
}

.nav-item.logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

/* --- Main Content --- */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.admin-header {
    display: flex;
    align-items: center;
    padding: 16px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    margin: 5px 0;
    transition: var(--transition);
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    flex: 1;
}

.admin-user {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-content {
    padding: 32px;
    flex: 1;
}

/* =============================================
   CARDS & STATS
   ============================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
}

/* =============================================
   TABLES
   ============================================= */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(42, 42, 62, 0.5);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .clickable-row {
    cursor: pointer;
}

.data-table .clickable-row:hover td {
    background: rgba(0, 240, 255, 0.03);
    color: var(--text-primary);
}

/* =============================================
   STATUS BADGES
   ============================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--badge-color, var(--text-muted));
    background: color-mix(in srgb, var(--badge-color, var(--text-muted)) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--badge-color, var(--text-muted)) 30%, transparent);
}

/* =============================================
   ACTION BAR
   ============================================= */

.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.action-bar .filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-bar .filters select {
    padding: 8px 36px 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b6b80' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* =============================================
   GIG EDITOR
   ============================================= */

.tier-editor {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.tier-editor-header {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--accent-cyan);
}

.feature-list {
    list-style: none;
    margin-bottom: 12px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.feature-list input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.feature-list input:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

.btn-remove-feature,
.btn-remove-faq {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 1.2rem;
    line-height: 1;
    transition: var(--transition);
}

.btn-remove-feature:hover,
.btn-remove-faq:hover {
    color: #ef4444;
}

.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.price-grid label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.price-grid input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.price-grid input:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

.faq-editor-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

/* =============================================
   ORDER DETAIL
   ============================================= */

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.info-group {
    margin-bottom: 16px;
}

.info-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 1rem;
    color: var(--text-primary);
}

.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-entry {
    position: relative;
    margin-bottom: 20px;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 2px solid var(--bg-dark);
}

.timeline-entry .timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timeline-entry .timeline-status {
    font-weight: 700;
    margin-bottom: 2px;
}

.timeline-entry .timeline-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* =============================================
   EMPTY STATES
   ============================================= */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* =============================================
   MODAL
   ============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 90%;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-header {
        padding: 12px 16px;
    }

    .admin-content {
        padding: 16px;
    }

    .form-row,
    .form-row.three-col {
        grid-template-columns: 1fr;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .price-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
}
