:root {
    --accent-teal: #00D4AA;
    --accent-teal-dark: #00B894;
    --accent-coral: #FF6B6B;
    --accent-gold: #FFD93D;
    --accent-purple: #A855F7;
    --primary: #0A2540;
    --primary-light: #1A4060;
    --secondary: #00D4AA;
    --danger: #FF6B6B;
    --warning: #FFD93D;
    --info: #3B82F6;
    --dark: #0A1929;
    --gray-900: #0F172A;
    --gray-800: #1E293B;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748B;
    --gray-400: #94A3B8;
    --gray-300: #CBD5E1;
    --gray-200: #E2E8F0;
    --gray-100: #F1F5F9;
    --gray-50: #F8FAFC;
    --white: #FFFFFF;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.15);
    --shadow-glow: 0 0 40px rgba(0, 212, 170, 0.15);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --bg-gradient-start: #0A1929;
    --bg-gradient-mid: #0A2540;
    --bg-gradient-end: #1A4060;
    --sidebar-bg: rgba(10, 25, 41, 0.95);
    --card-bg: rgba(255, 255, 255, 0.03);
    --text-primary: var(--gray-100);
    --text-secondary: var(--gray-400);
}

[data-theme="light"] {
    --bg-gradient-start: #FFFFFF;
    --bg-gradient-mid: #F8FAFC;
    --bg-gradient-end: #F1F5F9;
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 170, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 107, 107, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

#app {
    min-height: 100vh;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1.5rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 212, 170, 0.2);
    border-top-color: var(--accent-teal);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

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

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

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .sidebar {
    border-right-color: rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.75rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.875rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    margin: 0.125rem 0;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(0, 212, 170, 0.08);
    color: var(--white);
    border-left-color: rgba(0, 212, 170, 0.5);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.15) 0%, transparent 100%);
    color: var(--accent-teal);
    border-left-color: var(--accent-teal);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
}

.topbar {
    background: rgba(10, 25, 41, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.credits-display {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15) 0%, rgba(0, 212, 170, 0.05) 100%);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: var(--radius);
    font-weight: 700;
    color: var(--accent-teal);
}

.credits-display svg {
    color: var(--accent-gold);
}

.user-menu {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    color: var(--gray-300);
}

.user-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-button span {
    font-weight: 500;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-purple) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.page-content {
    padding: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 212, 170, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary { background: rgba(0, 212, 170, 0.15); color: var(--accent-teal); }
.stat-icon.success { background: rgba(0, 212, 170, 0.15); color: var(--accent-teal); }
.stat-icon.warning { background: rgba(255, 217, 61, 0.15); color: var(--accent-gold); }
.stat-icon.info { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
    margin-bottom: 0.375rem;
    letter-spacing: -0.03em;
}

.stat-label {
    color: var(--gray-400);
    font-size: 0.875rem;
    font-weight: 500;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--white);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-teal-dark) 100%);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-teal) 0%, #00B894 100%);
    color: var(--primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-coral) 0%, #E55050 100%);
    color: var(--white);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #E6C235 100%);
    color: var(--primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.625rem;
    color: var(--gray-200);
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--white);
    transition: all 0.25s;
}

.form-input::placeholder {
    color: var(--gray-500);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-teal);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.15);
}

.form-input:disabled {
    background: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
    opacity: 0.6;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394A3B8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

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

.form-error {
    color: var(--accent-coral);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

th {
    font-weight: 700;
    color: var(--gray-300);
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

td {
    color: var(--gray-200);
}

tr:hover td {
    background: rgba(0, 212, 170, 0.05);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success { background: rgba(0, 212, 170, 0.15); color: var(--accent-teal); }
.badge-warning { background: rgba(255, 217, 61, 0.15); color: var(--accent-gold); }
.badge-danger { background: rgba(255, 107, 107, 0.15); color: var(--accent-coral); }
.badge-info { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.badge-primary { background: rgba(0, 212, 170, 0.15); color: var(--accent-teal); }

.badge-tier-free { background: rgba(100, 116, 139, 0.2); color: var(--gray-300); }
.badge-tier-bronze { background: rgba(205, 127, 50, 0.2); color: #CD7F32; }
.badge-tier-silver { background: rgba(192, 192, 192, 0.2); color: #C0C0C0; }
.badge-tier-gold { background: rgba(255, 217, 61, 0.2); color: var(--accent-gold); }
.badge-tier-platinum { background: rgba(168, 85, 247, 0.2); color: var(--accent-purple); }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 41, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 212, 170, 0.1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1.25rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 107, 107, 0.2);
    color: var(--accent-coral);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success { background: rgba(0, 212, 170, 0.15); color: var(--accent-teal); border: 1px solid rgba(0, 212, 170, 0.3); }
.alert-danger { background: rgba(255, 107, 107, 0.15); color: var(--accent-coral); border: 1px solid rgba(255, 107, 107, 0.3); }
.alert-warning { background: rgba(255, 217, 61, 0.15); color: var(--accent-gold); border: 1px solid rgba(255, 217, 61, 0.3); }
.alert-info { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); border: 1px solid rgba(168, 85, 247, 0.3); }

.tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.875rem 1.25rem;
    color: var(--gray-400);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}

.tab:hover {
    color: var(--gray-200);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    color: var(--accent-teal);
    border-bottom-color: var(--accent-teal);
    background: rgba(0, 212, 170, 0.08);
}

.surf-frame-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    background: var(--dark);
}

.surf-toolbar {
    background: rgba(10, 25, 41, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.surf-timer {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 70px;
    text-align: center;
    letter-spacing: -0.03em;
}

.timer-progress {
    width: 220px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-teal) 0%, var(--accent-purple) 100%);
    transition: width 1s linear;
    border-radius: 5px;
}

.surf-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.surf-credits {
    text-align: center;
}

.surf-credits-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-teal);
}

.surf-credits-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.surf-frame {
    flex: 1;
    border: none;
    width: 100%;
    background: #fff;
}

.surf-ads {
    background: rgba(10, 25, 41, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.875rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    flex-shrink: 0;
}

.text-ad {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
}

.text-ad:hover {
    background: rgba(0, 212, 170, 0.1);
    border-color: rgba(0, 212, 170, 0.3);
}

.text-ad a {
    color: var(--accent-teal);
    text-decoration: none;
    font-weight: 600;
}

.text-ad a:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-400);
    margin-bottom: 1.5rem;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.achievement-card.earned {
    border-color: rgba(0, 212, 170, 0.4);
    background: rgba(0, 212, 170, 0.08);
}

.achievement-card.locked {
    opacity: 0.5;
}

.achievement-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.achievement-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    background: rgba(255, 255, 255, 0.05);
}

.achievement-name {
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.375rem;
}

.achievement-description {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
}

.achievement-points {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent-teal);
}

.preview-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.preview-container.site-preview {
    min-height: 150px;
}

.preview-container.site-preview iframe {
    width: 100%;
    height: 200px;
    border: none;
    border-radius: var(--radius-sm);
    transform: scale(0.5);
    transform-origin: top left;
    pointer-events: none;
}

.item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all 0.3s;
}

.item-card:hover {
    border-color: rgba(0, 212, 170, 0.3);
    background: rgba(0, 212, 170, 0.05);
}

.item-preview {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-preview img {
    max-width: 100%;
    height: auto;
}

.item-details {
    font-size: 0.875rem;
}

.item-title {
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.item-meta {
    color: var(--gray-400);
    font-size: 0.8125rem;
}

.item-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .topbar {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 30% 30%, rgba(0, 212, 170, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(168, 85, 247, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

.auth-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 80px rgba(0, 212, 170, 0.08);
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-teal) 0%, var(--accent-purple) 100%);
}

.auth-header {
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
}

.auth-logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.auth-title {
    font-size: 1.125rem;
    color: var(--gray-300);
    font-weight: 500;
}

.auth-body {
    padding: 1.5rem 2rem 2rem;
}

.auth-footer {
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-400);
}

.auth-footer a {
    color: var(--accent-teal);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.admin-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
}

.admin-login-card {
    background: rgba(22, 33, 62, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 60px rgba(168, 85, 247, 0.1);
}

.admin-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-purple) 0%, var(--accent-coral) 100%);
}

.admin-login-header {
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
    position: relative;
}

.admin-login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-purple) 0%, var(--accent-coral) 100%);
}

.admin-login-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-coral) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.admin-login-title {
    font-size: 1rem;
    color: var(--gray-400);
    font-weight: 500;
}

.achievement-popup {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.95) 0%, rgba(0, 184, 148, 0.95) 100%);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideIn 0.5s ease, slideOut 0.5s ease 2.5s forwards;
    color: var(--primary);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.hidden {
    display: none !important;
}

a {
    color: var(--accent-teal);
}

a:hover {
    color: var(--accent-teal-dark);
}

code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    color: var(--accent-teal);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.leaderboard-item:hover {
    background: rgba(0, 212, 170, 0.05);
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--gray-400);
}

.leaderboard-rank.top-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: var(--primary);
}

.leaderboard-rank.top-2 {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: var(--primary);
}

.leaderboard-rank.top-3 {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: white;
}

.leaderboard-user {
    flex: 1;
}

.leaderboard-username {
    font-weight: 700;
    color: var(--white);
}

.leaderboard-stat {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.leaderboard-value {
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--accent-teal);
}

.referral-link-box {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.referral-link-box input {
    flex: 1;
}

.tier-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.tier-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 170, 0.3);
    box-shadow: var(--shadow-glow);
}

.tier-card.featured {
    border-color: var(--accent-teal);
    background: linear-gradient(180deg, rgba(0, 212, 170, 0.1) 0%, transparent 100%);
}

.tier-card.featured::before {
    content: 'POPULAR';
    position: absolute;
    top: 1rem;
    right: -2rem;
    background: var(--accent-teal);
    color: var(--primary);
    padding: 0.25rem 2rem;
    font-size: 0.625rem;
    font-weight: 800;
    transform: rotate(45deg);
    letter-spacing: 0.1em;
}

.tier-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.tier-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-teal);
    margin-bottom: 1rem;
}

.tier-price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-400);
}

.tier-features {
    list-style: none;
    margin-bottom: 1.5rem;
    text-align: left;
}

.tier-features li {
    padding: 0.5rem 0;
    color: var(--gray-300);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tier-features li::before {
    content: '✓';
    color: var(--accent-teal);
    font-weight: 700;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s;
    color: var(--gray-300);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--gray-700);
}


[data-theme="light"] .card,
[data-theme="light"] .stat-card {
    background: var(--card-bg);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .credits-display {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2) 0%, rgba(0, 212, 170, 0.1) 100%);
}

[data-theme="light"] .nav-item {
    color: var(--gray-600);
}

[data-theme="light"] .nav-item:hover {
    background: rgba(0, 212, 170, 0.1);
    color: var(--gray-900);
}

[data-theme="light"] .nav-item.active {
    color: var(--accent-teal-dark);
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 170, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
}

[data-theme="light"] .form-input {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--gray-900);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--gray-800);
}

/* ========================================
   DROPDOWN / SELECT FIXES - Visible text
   ======================================== */
select.form-input {
    background-color: rgba(15, 23, 42, 0.95);
    color: #F1F5F9;
}

select.form-input option {
    background-color: #1E293B;
    color: #F1F5F9;
    padding: 0.75rem 1rem;
}

select.form-input option:hover,
select.form-input option:focus,
select.form-input option:checked {
    background-color: #00D4AA;
    color: #0A1929;
}

[data-theme="light"] select.form-input {
    background-color: rgba(255, 255, 255, 0.95);
    color: #1E293B;
}

[data-theme="light"] select.form-input option {
    background-color: #FFFFFF;
    color: #1E293B;
}

[data-theme="light"] select.form-input option:checked {
    background-color: #00D4AA;
    color: #0A1929;
}

/* ========================================
   TOGGLE SWITCH FIXES - Better visibility
   ======================================== */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: rgba(100, 116, 139, 0.4);
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #FFFFFF;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active {
    background: linear-gradient(135deg, #00D4AA 0%, #00B894 100%);
    border-color: #00D4AA;
}

.toggle-switch.active::after {
    left: 27px;
}

.toggle-switch.inactive {
    background: linear-gradient(135deg, #FF6B6B 0%, #E55050 100%);
    border-color: #FF6B6B;
}

/* ========================================
   THEME TOGGLE BUTTON
   ======================================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--accent-gold);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 217, 61, 0.2);
    border-color: var(--accent-gold);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #A855F7;
}

/* ========================================
   TOP BAR NAVIGATION LAYOUT
   ======================================== */
.layout.top-nav-layout .sidebar {
    display: none;
}

.layout.top-nav-layout .main-content {
    margin-left: 0;
}

.layout.top-nav-layout .topbar {
    flex-wrap: wrap;
    padding: 0.75rem 1.5rem;
}

.top-nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.top-nav-menu .nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.2s;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    background: none;
    cursor: pointer;
}

.top-nav-menu .nav-item:hover {
    background: rgba(0, 212, 170, 0.1);
    color: var(--white);
}

.top-nav-menu .nav-item.active {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-teal);
}

.top-nav-menu .nav-item svg {
    width: 18px;
    height: 18px;
}

[data-theme="light"] .top-nav-menu {
    border-top-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .top-nav-menu .nav-item {
    color: var(--gray-600);
}

[data-theme="light"] .top-nav-menu .nav-item:hover {
    background: rgba(0, 212, 170, 0.15);
    color: var(--gray-900);
}

/* ========================================
   SITE/BANNER/TEXT AD CARD IMPROVEMENTS
   ======================================== */
.item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.item-card:hover {
    border-color: rgba(0, 212, 170, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.item-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.item-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.item-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.item-card .toggle-switch {
    flex-shrink: 0;
}

/* Action buttons in cards */
.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-400);
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.action-btn.edit:hover {
    background: rgba(0, 212, 170, 0.2);
    color: var(--accent-teal);
    border-color: var(--accent-teal);
}

.action-btn.delete:hover {
    background: rgba(255, 107, 107, 0.2);
    color: var(--accent-coral);
    border-color: var(--accent-coral);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* Light mode card fixes */
[data-theme="light"] .item-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .item-card-title {
    color: #1E293B;
}

[data-theme="light"] .action-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748B;
}

/* ========================================
   COMPREHENSIVE LIGHT MODE OVERRIDES
   ======================================== */
[data-theme="light"] {
    --white: #FFFFFF;
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 50%, #F1F5F9 100%);
    color: #1E293B;
}

[data-theme="light"] body::before {
    background: none;
}

[data-theme="light"] .sidebar {
    background: #FFFFFF;
    border-right-color: #E2E8F0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .sidebar-header {
    border-bottom-color: #E2E8F0;
}

[data-theme="light"] .sidebar-footer {
    border-top-color: #E2E8F0;
}

[data-theme="light"] .nav-section-title {
    color: #64748B;
}

[data-theme="light"] .main-content {
    background: transparent;
}

[data-theme="light"] .topbar {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .page-title {
    color: #1E293B;
}

[data-theme="light"] .card {
    background: #FFFFFF;
    border-color: #E2E8F0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .card-header {
    border-bottom-color: #E2E8F0;
}

[data-theme="light"] .card-title {
    color: #1E293B;
}

[data-theme="light"] .stat-card {
    background: #FFFFFF;
    border-color: #E2E8F0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .stat-card:hover {
    background: #FFFFFF;
    border-color: #00D4AA;
}

[data-theme="light"] .stat-value {
    color: #1E293B;
}

[data-theme="light"] .stat-label {
    color: #64748B;
}

[data-theme="light"] .empty-state h3 {
    color: #1E293B;
}

[data-theme="light"] .empty-state p {
    color: #64748B;
}

[data-theme="light"] .empty-state svg {
    color: #94A3B8;
}

[data-theme="light"] .modal-content {
    background: #FFFFFF;
    border-color: #E2E8F0;
}

[data-theme="light"] .modal-header {
    border-bottom-color: #E2E8F0;
}

[data-theme="light"] .modal-header h3 {
    color: #1E293B;
}

[data-theme="light"] .modal-footer {
    border-top-color: #E2E8F0;
    background: #F8FAFC;
}

[data-theme="light"] .table th {
    background: #F8FAFC;
    color: #475569;
    border-bottom-color: #E2E8F0;
}

[data-theme="light"] .table td {
    color: #1E293B;
    border-bottom-color: #F1F5F9;
}

[data-theme="light"] .achievement-card {
    background: #FFFFFF;
    border-color: #E2E8F0;
}

[data-theme="light"] .achievement-card h4 {
    color: #1E293B;
}

[data-theme="light"] .achievement-card p {
    color: #64748B;
}

[data-theme="light"] .tier-card {
    background: #FFFFFF;
    border-color: #E2E8F0;
}

[data-theme="light"] .tier-name {
    color: #1E293B;
}

[data-theme="light"] .tier-features li {
    color: #475569;
}

[data-theme="light"] .alert {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .leaderboard-item {
    background: #FFFFFF;
    border-color: #E2E8F0;
}

[data-theme="light"] .leaderboard-name {
    color: #1E293B;
}

[data-theme="light"] .leaderboard-value {
    color: #475569;
}

[data-theme="light"] .nav-item {
    color: #475569;
}

[data-theme="light"] .nav-item:hover {
    background: rgba(0, 212, 170, 0.1);
    color: #1E293B;
}

[data-theme="light"] .nav-item.active {
    background: rgba(0, 212, 170, 0.15);
    color: #00B894;
}

[data-theme="light"] .form-label {
    color: #475569;
}

[data-theme="light"] .form-input {
    background: #FFFFFF;
    border-color: #E2E8F0;
    color: #1E293B;
}

[data-theme="light"] .form-input:focus {
    border-color: #00D4AA;
}

[data-theme="light"] .form-input::placeholder {
    color: #94A3B8;
}

[data-theme="light"] .btn-secondary {
    background: #F1F5F9;
    border-color: #E2E8F0;
    color: #475569;
}

[data-theme="light"] .btn-secondary:hover {
    background: #E2E8F0;
    color: #1E293B;
}

[data-theme="light"] .credits-display {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(0, 212, 170, 0.08));
}

[data-theme="light"] .user-menu span {
    color: #1E293B;
}

[data-theme="light"] .item-card-stats {
    color: #64748B;
}
