/* =============================================
   ROOT VARIABLES & GLOBAL THEME
   ============================================= */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #ec4899;
    --gold: #f59e0b;
    --gold-dark: #d97706;
    --gold-light: #fbbf24;
    --bg: #0a0a14;
    --bg-secondary: #0f0f1e;
    --surface: rgba(255,255,255,0.03);
    --surface-hover: rgba(255,255,255,0.05);
    --card-bg: rgba(20,20,40,0.6);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.4);
    --shadow-lg: 0 25px 50px -12px rgba(0,0,0,0.5);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;   /* prevents horizontal scroll */
}

a {
    text-decoration: none;
    color: inherit;
}

/* =============================================
   AUTH PAGES – centred layout
   ============================================= */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* =============================================
   BACKGROUND EFFECTS (mesh, orbs, particles)
   ============================================= */
.bg-mesh {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(236,72,153,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 40%, rgba(99,102,241,0.05) 0%, transparent 50%);
}

.bg-glow {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236,72,153,0.05) 0%, transparent 50%);
}

/* 🌈 GRADIENT ORBS – clearly visible on all pages */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
    animation: float 20s infinite ease-in-out;
    z-index: 1;
}

.orb-1 {
    width: 500px; height: 500px;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    top: -150px; left: -100px;
}

.orb-2 {
    width: 400px; height: 400px;
    background: linear-gradient(135deg, #ec4899, #f59e0b);
    bottom: -120px; right: -80px;
    animation-delay: -10s;
}

.orb-3 {
    width: 300px; height: 300px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    top: 50%; left: 50%;
    animation-delay: -5s;
}

/* =============================================
   AUTH PAGES (login, register, forgot, reset)
   ============================================= */
.login-wrapper,
.register-wrapper,
.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 460px;
    padding: 20px;
}

.login-card,
.register-card,
.auth-card {
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    animation: cardEntry 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.login-card::before,
.register-card::after,
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

.logo-area {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon,
.logo-shield {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 15px 40px rgba(99,102,241,0.3);
    animation: logoFloat 3s ease-in-out infinite;
    font-size: 28px;
    color: white;
}

.logo-shield {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
    box-shadow: 0 20px 50px rgba(245,158,11,0.3), 0 0 0 8px rgba(245,158,11,0.05);
    color: #0a0a14;
}

.logo-area h2 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.logo-area p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.input-wrap {
    position: relative;
}

.input-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    transition: var(--transition);
    pointer-events: none;
}

.input-wrap input,
.input-wrap textarea,
.input-wrap select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
}

.input-wrap textarea {
    padding-left: 16px;
    min-height: 120px;
    resize: vertical;
}

/* Room for eye icon / toggle button inside password fields */
.input-wrap input[type="password"],
.input-wrap input[name="password"],
.input-wrap input[name="confirm_password"] {
    padding-right: 50px;
}

.input-wrap input::placeholder {
    color: var(--text-muted);
}

.input-wrap input:focus,
.input-wrap textarea:focus,
.input-wrap select:focus {
    border-color: var(--primary);
    background: rgba(99,102,241,0.05);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.input-wrap input:focus ~ i,
.input-wrap input:focus + i {
    color: var(--primary-light);
}

/* Password toggle button – completely inside the input */
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-light);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    z-index: 2;
}

.password-toggle:hover { color: var(--primary); }

/* =============================================
   BUTTONS
   ============================================= */
.btn-login,
.btn-register,
.btn-submit,
.btn-admin-login {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
    color: white;
}

.btn-login { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
.btn-register { background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%); }
.btn-submit { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.btn-admin-login {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    color: #0a0a14;
}

.btn-login:hover,
.btn-register:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(99,102,241,0.35);
}

.btn-admin-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(245,158,11,0.4);
}

/* Ripple effect */
.btn-ripple .ripple,
.btn-login .ripple,
.btn-admin-login .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.btn-admin-login .ripple { background: rgba(0,0,0,0.2); }

/* =============================================
   OPTIONS ROW (remember me + forgot password)
   ============================================= */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* =============================================
   LINKS (forgot, signup, etc.)
   ============================================= */
.forgot-link {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover { color: var(--primary); }

.signup-link {
    text-align: center;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 14px;
}

.signup-link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.signup-link a:hover { color: var(--primary); }

.login-link {
    text-align: center;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 14px;
}

.login-link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.login-link a:hover { color: var(--primary); }

/* =============================================
   ALERTS / MESSAGES
   ============================================= */
.alert,
.error-msg,
.success-msg {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.4s ease;
}

.alert-success,
.success-msg {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    color: #34d399;
}

.alert-error,
.error-msg {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* =============================================
   NAVBAR & DASHBOARD
   ============================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,10,20,0.8);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.5s ease;
    overflow: visible !important;   /* ← ensure dropdown isn't clipped */
}

.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-logo {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   PROFILE AVATAR & DROPDOWN
   ============================================= */
.profile-area { position: relative; }

.avatar {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.avatar:hover {
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    background: rgba(20,20,40,0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 200px;
    display: none;
    z-index: 200;
    overflow: hidden;
    animation: dropdownIn 0.2s ease;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.dropdown.show { display: block; }

.dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown a:hover { background: var(--surface-hover); color: var(--text); }
.dropdown .divider { height: 1px; background: var(--border); }
.dropdown a.text-danger { color: #f87171; }

/* =============================================
   STATS CARDS (dashboard)
   ============================================= */
.stats-row,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    animation: fadeIn 0.6s ease forwards;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(99,102,241,0.15);
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 20px;
}

.stat-icon.purple { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.stat-icon.pink { background: rgba(236,72,153,0.15); color: var(--accent); }
.stat-icon.green { background: rgba(16,185,129,0.15); color: #34d399; }
.stat-icon.gold { background: rgba(245,158,11,0.15); color: var(--gold); }

.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   PAGE CARDS (dashboard grid)
   ============================================= */
.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.page-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.page-card.visible { opacity: 1; }

.page-card:hover {
    border-color: var(--primary);
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1));
    position: relative;
    overflow: hidden;
}

.card-icon::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.card-icon i,
.card-icon svg,
.card-icon .emoji-icon {
    width: 48px; height: 48px;
    font-size: 48px;
    transition: var(--transition);
}

.page-card:hover .card-icon i,
.page-card:hover .card-icon svg {
    transform: scale(1.1);
}

.card-body { padding: 20px 24px; }
.card-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.card-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(99,102,241,0.15);
    color: var(--primary-light);
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.card-url { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; word-break: break-all; }
.card-url a { color: var(--primary-light); }
.card-date { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.card-actions { display: flex; gap: 8px; }

/* Buttons inside cards */
.btn-sm {
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-edit { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.btn-edit:hover { background: rgba(99,102,241,0.25); }
.btn-view { background: rgba(255,255,255,0.05); color: var(--text-secondary); }
.btn-view:hover { background: rgba(255,255,255,0.1); }
.btn-delete { background: rgba(239,68,68,0.15); color: #f87171; }
.btn-delete:hover { background: rgba(239,68,68,0.25); }
.btn-sub { background: rgba(16,185,129,0.15); color: #34d399; }
.btn-sub:hover { background: rgba(16,185,129,0.25); }

/* Placeholder data & submissions inside cards */
.placeholder-data,
.submissions-data {
    background: rgba(99,102,241,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 14px;
    margin-bottom: 12px;
    font-size: 13px;
}

.submissions-data { background: rgba(236,72,153,0.05); }

.placeholder-data h4,
.submissions-data h4 {
    margin-bottom: 10px;
    font-size: 13px;
}

.placeholder-data h4 { color: var(--primary-light); }
.submissions-data h4 { color: var(--accent); }

.data-row,
.data-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.data-row:last-child { border-bottom: none; }
.data-key { color: var(--text-secondary); font-weight: 600; }
.data-value { color: var(--text); max-width: 60%; text-align: right; word-break: break-word; }

.sub-entry {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.sub-entry:last-child { border-bottom: none; }
.sub-time { color: var(--text-muted); font-size: 11px; margin-bottom: 3px; }
.sub-fields { color: var(--text-secondary); }

/* Copy button for submissions */
.btn-copy {
    background: rgba(99,102,241,0.1);
    border: 1px solid var(--border);
    color: var(--primary-light);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.2s;
}
.btn-copy:hover {
    background: rgba(99,102,241,0.2);
}

/* =============================================
   ADMIN PAGES (tables, sections)
   ============================================= */
.section {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.section h2 i { color: var(--gold); }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;      /* ← fix vertical text */
    min-width: 60px;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(99,102,241,0.03); }
tbody tr:last-child td { border-bottom: none; }

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-admin { background: rgba(245,158,11,0.15); color: var(--gold); }
.badge-user { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.btn-xs {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
    transition: var(--transition);
}

.btn-view { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.btn-view:hover { background: rgba(99,102,241,0.25); }
.btn-del { background: rgba(239,68,68,0.15); color: #f87171; }
.btn-del:hover { background: rgba(239,68,68,0.25); }

/* =============================================
   PROFILE PAGE
   ============================================= */
.profile-card {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.profile-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(236,72,153,0.2));
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.profile-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

.avatar-large {
    width: 90px; height: 90px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: 0 15px 40px rgba(99,102,241,0.3);
    animation: pulse 3s ease-in-out infinite;
}

.profile-header h2 { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 4px; }

.role-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.role-badge.admin { background: rgba(245,158,11,0.15); color: var(--gold); }
.role-badge.user { background: rgba(99,102,241,0.15); color: var(--primary-light); }

.profile-body { padding: 30px; }

.info-group {
    display: flex; align-items: center; gap: 16px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    transition: var(--transition);
}

.info-group:hover { border-color: var(--primary); background: rgba(99,102,241,0.03); }

.info-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.info-icon.purple { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.info-icon.pink { background: rgba(236,72,153,0.15); color: var(--accent); }
.info-icon.green { background: rgba(16,185,129,0.15); color: #34d399; }
.info-icon.amber { background: rgba(245,158,11,0.15); color: var(--gold); }

.info-content { flex: 1; }
.info-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 3px; }
.info-value { font-size: 15px; font-weight: 500; color: var(--text); word-break: break-word; }

.stat-mini {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
}

.stat-mini:hover { border-color: var(--primary); }

.stat-mini .value { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.stat-mini .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Compact back button */
.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    margin-top: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    width: auto;
}

.btn-back:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: var(--primary-light); }

/* =============================================
   SETTINGS PAGE (change password)
   ============================================= */
.settings-card {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.settings-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(236,72,153,0.15));
    padding: 32px 30px;
    text-align: center;
    position: relative;
}

.settings-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

.settings-icon {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 26px;
    color: white;
    box-shadow: 0 15px 40px rgba(99,102,241,0.3);
    animation: float 3s ease-in-out infinite;
}

.settings-header h2 { font-size: 24px; font-weight: 700; color: var(--text); }
.settings-header p { color: var(--text-muted); font-size: 14px; }

.settings-body { padding: 30px; }

/* =============================================
   PAGE EDITOR (edit_page.php) – shared classes
   ============================================= */
.builder-container {
    max-width: 850px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

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

.builder-header h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   SCROLLABLE TEMPLATE PICKER
   ============================================= */
.template-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-scroll {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 12px;
    padding: 8px 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
}

.template-scroll::-webkit-scrollbar {
    display: none;
}

.scroll-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.scroll-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
    border-color: var(--primary-light);
}

/* Enlarged template items for the scrollable picker */
.template-scroll .template-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid var(--border);
    background: var(--surface);
    min-width: 85px;
    flex-shrink: 0;
}

.template-scroll .template-item:hover {
    border-color: var(--primary-light);
    background: rgba(99,102,241,0.05);
}

.template-scroll .template-item.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 8px 25px rgba(99,102,241,0.3);
    transform: translateY(-2px);
}

.template-scroll .template-item.selected i { color: white !important; }
.template-scroll .template-item input[type="radio"] { display: none; }

.template-scroll .template-item i {
    font-size: 26px;
    transition: var(--transition);
}

.template-scroll .template-item .t-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.template-scroll .template-item.selected .t-label { color: white; }

/* Raw text panel (data preview) */
.raw-text-panel {
    background: #0d0d1a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    color: #10b981;
    white-space: pre-wrap;
    line-height: 1.6;
    overflow-x: auto;
}

.image-preview {
    max-width: 200px;
    border-radius: var(--radius-xs);
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.warning-text { color: #fbbf24; font-size: 12px; margin-top: 6px; font-weight: 500; display: flex; align-items: center; gap: 4px; }

.btn-row { display: flex; gap: 12px; margin-top: 24px; }

.btn-save {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-xs);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(99,102,241,0.35); }

.btn-cancel {
    padding: 14px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* =============================================
   PUBLIC PAGES
   ============================================= */
.public-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
}

.public-card {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.public-card .logo-icon {
    font-size: 52px;
    margin-bottom: 12px;
    animation: pulse 2.5s ease-in-out infinite;
}

.public-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }

.footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 11px;
    color: var(--text-muted);
}

.extra-links {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.extra-links a { color: var(--primary-light); text-decoration: none; font-weight: 600; }
.extra-links a:hover { text-decoration: underline; }
.extra-links div { margin: 6px 0; }

/* =============================================
   404 ERROR PAGE
   ============================================= */
.error-wrapper {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.error-code {
    font-size: clamp(120px, 20vw, 220px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 30%, #f87171 60%, #ef4444 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    position: relative;
}

.error-code::after {
    content: '404';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(30px);
    opacity: 0.4;
    z-index: -1;
}

.glitch-text {
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 16px;
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: 'ACCESS DENIED';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
}

.glitch-text::before { color: #ef4444; animation: glitch1 2s infinite; }
.glitch-text::after { color: #3b82f6; animation: glitch2 2s infinite; }

.lock-icon {
    display: inline-block;
    font-size: 40px;
    margin-bottom: 20px;
    color: #ef4444;
    animation: lockShake 2s infinite;
}

.description {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-home:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: var(--text);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.scan-line {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: rgba(239,68,68,0.1);
    pointer-events: none;
    z-index: 999;
    animation: scanDown 4s linear infinite;
}

.particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    background: rgba(239,68,68,0.3);
    border-radius: 50%;
    animation: particleFloat 6s infinite ease-in-out;
}

.particle:nth-child(1) { width: 4px; height: 4px; top: 20%; left: 30%; animation-delay: 0s; }
.particle:nth-child(2) { width: 2px; height: 2px; top: 60%; left: 70%; animation-delay: -1s; }
.particle:nth-child(3) { width: 3px; height: 3px; top: 40%; left: 50%; animation-delay: -2s; }
.particle:nth-child(4) { width: 5px; height: 5px; top: 70%; left: 20%; animation-delay: -3s; }
.particle:nth-child(5) { width: 2px; height: 2px; top: 30%; left: 80%; animation-delay: -4s; }
.particle:nth-child(6) { width: 3px; height: 3px; top: 80%; left: 60%; animation-delay: -5s; }

/* =============================================
   ADMIN LOGIN
   ============================================= */
.admin-card {
    background: rgba(15, 15, 30, 0.75);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: var(--radius);
    padding: 44px 40px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(245,158,11,0.1) inset, 0 0 80px rgba(245,158,11,0.05);
    animation: cardEntry 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.admin-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(245,158,11,0.05), transparent, rgba(245,158,11,0.05), transparent);
    animation: rotate 10s linear infinite;
    z-index: -1;
}

.admin-card::after {
    content: '';
    position: absolute;
    top: 0; left: 10%; width: 80%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: shimmer 3s infinite;
}

.forgot-link {
    display: block;
    text-align: right;
    margin-top: 8px;
    color: var(--primary-light);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover { color: var(--primary); }

/* =============================================
   KEYFRAME ANIMATIONS
   ============================================= */
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes cardEntry {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 15px 40px rgba(99,102,241,0.3); }
    50% { transform: scale(1.05); box-shadow: 0 20px 50px rgba(236,72,153,0.5); }
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes glitch1 {
    0%, 100% { opacity: 0; transform: translate(0); }
    1%, 3% { opacity: 0.8; transform: translate(-3px, 2px); }
    2%, 4% { opacity: 0; transform: translate(0); }
}

@keyframes glitch2 {
    0%, 100% { opacity: 0; transform: translate(0); }
    2% { opacity: 0.8; transform: translate(3px, -2px); }
    4% { opacity: 0; transform: translate(0); }
}

@keyframes lockShake {
    0%, 100% { transform: rotate(0); }
    10% { transform: rotate(-15deg); }
    20% { transform: rotate(15deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(10deg); }
    50% { transform: rotate(0); }
}

@keyframes scanDown {
    0% { top: -3px; }
    100% { top: 100%; }
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0); opacity: 0; }
    20% { opacity: 1; }
    50% { transform: translate(30px, -50px); opacity: 0.8; }
    80% { opacity: 0; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* =============================================
   RESPONSIVE ENHANCEMENTS
   ============================================= */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
        height: 56px;
    }
    .nav-title {
        display: none;
    }
    .pages-grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 20px 16px;
    }
    .section {
        padding: 16px;
    }
    .btn-row {
        flex-direction: column;
    }
    .stats-row,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .card-actions {
        flex-wrap: wrap;
    }
    .btn-sm {
        flex: 1 1 auto;
    }
    .builder-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .builder-header h1 {
        font-size: 20px;
    }
    .template-scroll .template-item {
        padding: 10px 14px;
        min-width: 70px;
    }
    .template-scroll .template-item i {
        font-size: 22px;
    }
    .template-scroll .template-item .t-label {
        font-size: 11px;
    }

    /* MOBILE DROPDOWN FIX */
    .dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 180px;
        width: max-content;
    }
}

@media (max-width: 480px) {
    .login-card,
    .register-card,
    .auth-card,
    .admin-card {
        padding: 32px 24px;
    }
    .logo-area h2 {
        font-size: 24px;
    }
    .error-code {
        font-size: 100px;
        letter-spacing: -4px;
    }
    .glitch-text {
        font-size: 18px;
        letter-spacing: 2px;
    }
    .description {
        font-size: 14px;
    }
    .navbar {
        padding: 10px 15px;
        flex-direction: row;
        gap: 10px;
        height: auto;
    }
    .header-actions {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .card-body {
        padding: 15px;
    }
    .card-actions {
        flex-direction: column;
    }
    .btn-sm {
        width: 100%;
    }
    .options-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .password-toggle {
        right: 4px;
    }
    .input-wrap input[type="password"] {
        padding-right: 40px;
    }
    .dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 180px;
        width: max-content;
    }
    table {
        font-size: 12px;
    }
    th, td {
        padding: 10px 12px;
    }
}