:root {
    --primary-color: #00D4AA;
    --secondary-color: #A855F7;
    --accent-color: #FF6B6B;
    --success-color: #00D4AA;
    --warning-color: #FFD93D;
    --danger-color: #FF6B6B;
    --info-color: #3B82F6;
    
    --text-color: #FEFEFE;
    --text-muted: #B0B0B0;
    --heading-color: #FEFEFE;
    --link-color: #00D4AA;
    --link-hover-color: #00B894;
    
    --bg-color: #0A1929;
    --bg-gradient-start: #0A1929;
    --bg-gradient-mid: #0A2540;
    --bg-gradient-end: #1A4060;
    --sidebar-bg: rgba(10, 25, 41, 0.95);
    --card-bg: rgba(20, 40, 60, 0.9);
    --card-border-color: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border-color: rgba(255, 255, 255, 0.2);
    
    --border-width: 2px;
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --border-radius-lg: 24px;
    
    --font-family: Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-h1: 26px;
    --font-size-h2: 22px;
    --font-size-h3: 18px;
    --font-size-small: 14px;
    
    --btn-primary-bg: #00D4AA;
    --btn-primary-text: #000000;
    --btn-secondary-bg: rgba(255, 255, 255, 0.1);
    --btn-secondary-text: #FEFEFE;
    --btn-danger-bg: #FF6B6B;
    --btn-danger-text: #FEFEFE;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.2);
    --shadow-glow: 0 0 40px rgba(0, 212, 170, 0.15);
}

[data-theme="light"] {
    --text-color: #1a1a1a !important;
    --text-muted: #555555 !important;
    --heading-color: #1a1a1a !important;
    --link-color: #008B8B;
    --link-hover-color: #006666;
    
    --bg-color: #F8F9FA;
    --bg-gradient-start: #F8F9FA !important;
    --bg-gradient-mid: #F0F2F5 !important;
    --bg-gradient-end: #E8EAED !important;
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --card-border-color: rgba(0, 0, 0, 0.12);
    --input-bg: #FFFFFF;
    --input-border-color: rgba(0, 0, 0, 0.25);
    
    --btn-primary-bg: #00B894;
    --btn-primary-text: #FFFFFF;
    --btn-secondary-bg: #E0E0E0;
    --btn-secondary-text: #1a1a1a;
    --btn-danger-bg: #E74C3C;
    --btn-danger-text: #FFFFFF;
    
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.08);
    --shadow: 0 2px 8px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 16px rgb(0 0 0 / 0.12);
    --shadow-lg: 0 8px 32px rgb(0 0 0 / 0.15);
    --shadow-glow: 0 0 20px rgba(0, 184, 148, 0.1);
    
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #333333;
    --gray-400: #444444;
    --gray-500: #555555;
    --gray-600: #666666;
    --gray-700: #777777;
    --gray-800: #1a1a1a;
    --gray-900: #111111;
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #F8F9FA 0%, #F0F2F5 50%, #E8EAED 100%) !important;
    background-attachment: fixed !important;
    color: #1a1a1a !important;
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 184, 148, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%) !important;
}

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

html {
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    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-color);
    line-height: 1.6;
    min-height: 100vh;
    font-size: var(--font-size-base);
}

h1, .h1 {
    font-size: var(--font-size-h1);
    color: var(--heading-color);
    font-weight: 700;
    line-height: 1.3;
}

h2, .h2 {
    font-size: var(--font-size-h2);
    color: var(--heading-color);
    font-weight: 600;
    line-height: 1.35;
}

h3, .h3 {
    font-size: var(--font-size-h3);
    color: var(--heading-color);
    font-weight: 600;
    line-height: 1.4;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

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: var(--border-width) solid var(--card-border-color);
    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: var(--border-width) solid var(--card-border-color);
}

.sidebar-logo {
    font-size: var(--font-size-h2);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 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: var(--font-size-small);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--text-muted);
    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;
    font-size: var(--font-size-base);
}

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

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

.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: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-bottom: var(--border-width) solid var(--card-border-color);
    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: var(--card-bg);
    backdrop-filter: blur(10px);
    border: var(--border-width) solid var(--card-border-color);
    border-radius: var(--border-radius);
    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(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    border-color: var(--primary-color);
    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(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
}

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

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

.stat-label {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    font-weight: 500;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: var(--border-width) solid var(--card-border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s;
}

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

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: var(--border-width) solid var(--card-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: var(--font-size-h3);
    font-weight: 700;
    color: var(--heading-color);
}

.card-body {
    padding: 1.5rem;
    color: var(--text-color);
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: var(--border-width) solid var(--card-border-color);
    background: rgba(0, 0, 0, 0.05);
}

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

.btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
    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);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border-color: var(--card-border-color);
}

.btn-secondary:hover {
    filter: brightness(1.1);
}

.btn-success {
    background: var(--success-color);
    color: #000000;
    border-color: var(--success-color);
}

.btn-danger {
    background: var(--btn-danger-bg);
    color: var(--btn-danger-text);
    border-color: var(--btn-danger-bg);
}

.btn-warning {
    background: var(--warning-color);
    color: #000000;
    border-color: var(--warning-color);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-small);
}

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

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

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: var(--border-width) solid var(--input-border-color);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    color: var(--text-color);
    transition: all 0.25s;
}

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

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

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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;
    border: var(--border-width) solid var(--card-border-color);
    border-radius: var(--border-radius);
}

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

th, td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: var(--border-width) solid var(--card-border-color);
    color: var(--text-color);
    font-size: var(--font-size-base);
}

th {
    font-weight: 700;
    color: var(--heading-color);
    background: rgba(0, 0, 0, 0.1);
    font-size: var(--font-size-small);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

td {
    color: var(--text-color);
}

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: var(--border-width) solid var(--card-border-color);
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
}

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

.tab:hover {
    color: var(--heading-color);
    background: rgba(var(--primary-rgb, 0, 212, 170), 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: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: var(--border-width) solid var(--card-border-color);
    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) !important;
    border-color: var(--card-border-color) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

[data-theme="light"] .stat-label {
    color: #555555 !important;
}

[data-theme="light"] .card-title,
[data-theme="light"] .card-header h3 {
    color: #1a1a1a !important;
}

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

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

[data-theme="light"] .sidebar-logo {
    background: linear-gradient(135deg, #008B6B 0%, #6B21A8 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

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

[data-theme="light"] .user-button {
    color: #1a1a1a;
}

[data-theme="light"] .user-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8F9FA 100%);
    border-color: rgba(0, 0, 0, 0.15);
}

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

[data-theme="light"] .modal-close {
    background: rgba(0, 0, 0, 0.05);
    color: #555555;
}

[data-theme="light"] .modal-close:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #E74C3C;
}

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

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

[data-theme="light"] .tab {
    color: #555555;
}

[data-theme="light"] .tab:hover {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .tab.active {
    color: #00B894;
    border-bottom-color: #00B894;
    background: rgba(0, 184, 148, 0.08);
}

[data-theme="light"] .empty-state h3,
[data-theme="light"] .empty-state p {
    color: #1a1a1a !important;
}

[data-theme="light"] table th {
    background: rgba(0, 0, 0, 0.03) !important;
    color: #1a1a1a !important;
}

[data-theme="light"] table td {
    color: #1a1a1a !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .badge {
    color: inherit;
}

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

[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: #555555;
}

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

[data-theme="light"] .nav-item.active {
    color: #00B894;
    background: linear-gradient(90deg, rgba(0, 184, 148, 0.15) 0%, transparent 100%);
}

[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: #1a1a1a !important;
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1a1a1a !important;
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a !important;
}

[data-theme="light"] .btn-outline-primary {
    border-color: #00B894;
    color: #00B894 !important;
    background: transparent;
}

[data-theme="light"] .btn-outline-primary:hover {
    background: rgba(0, 184, 148, 0.1);
}

[data-theme="light"] .card-body {
    color: #1a1a1a !important;
}

[data-theme="light"] .card-body * {
    color: inherit;
}

[data-theme="light"] .card-body h3,
[data-theme="light"] .card-body h4,
[data-theme="light"] .card-body p,
[data-theme="light"] .card-body span,
[data-theme="light"] .card-body a:not(.btn) {
    color: #1a1a1a !important;
}

[data-theme="light"] .stat-icon svg {
    stroke: currentColor;
}

/* ========================================
   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);
}

/* Topbar Navigation Dropdowns */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--gray-300);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.nav-dropdown-btn svg {
    width: 18px;
    height: 18px;
}

.nav-dropdown-btn .dropdown-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

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

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-300);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--accent-teal);
}

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

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

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

[data-theme="light"] .nav-dropdown-btn:hover {
    color: var(--gray-900);
}

[data-theme="light"] .nav-dropdown-menu {
    background: #ffffff;
    border-color: var(--gray-200);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

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

[data-theme="light"] .nav-dropdown-item:hover {
    background: rgba(0, 212, 170, 0.1);
    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;
}

/* ========================================
   LIGHT MODE ADDITIONAL FIXES
   ======================================== */
[data-theme="light"] body::before {
    background: none;
}

[data-theme="light"] .sidebar {
    border-right: var(--border-width) solid var(--card-border-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .topbar {
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-content {
    background: var(--card-bg);
}

[data-theme="light"] .modal-footer {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .table th {
    background: rgba(0, 0, 0, 0.03);
}

/* Light mode for public landing page */
[data-theme="light"] .public-site {
    background: linear-gradient(180deg, #FEFEFE 0%, #F0F4F8 50%, #E5EDF5 100%);
}

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

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

[data-theme="light"] .feature-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .feature-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

[data-theme="light"] .public-footer {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .public-nav-link {
    color: #1A202C;
}

[data-theme="light"] .public-nav-link:hover,
[data-theme="light"] .public-nav-link.active {
    color: var(--primary-color);
}

[data-theme="light"] .public-logo {
    background: linear-gradient(135deg, #008B6B 0%, #6B21A8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .landing-hero h1 {
    color: #000000 !important;
}

[data-theme="light"] .landing-hero .hero-subtitle {
    color: #4A4A4A !important;
}

[data-theme="light"] .feature-card h3 {
    color: #000000 !important;
}

[data-theme="light"] .feature-card p {
    color: #4A4A4A !important;
}

[data-theme="light"] .landing-cta h2 {
    color: #000000 !important;
}

[data-theme="light"] .landing-cta p {
    color: #4A4A4A !important;
}

[data-theme="light"] .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1A202C;
}

[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

/* ========================================
   PUBLIC LANDING PAGE STYLES
   ======================================== */
.public-site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    position: relative;
    z-index: 1;
}

.public-header {
    background: var(--card-bg);
    border-bottom: var(--border-width) solid var(--card-border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.public-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.public-logo {
    font-size: var(--font-size-h2);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.public-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.public-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-base);
    transition: color 0.2s;
    padding: 0.5rem;
}

.public-nav-link:hover,
.public-nav-link.active {
    color: var(--primary-color);
}

.theme-toggle-btn {
    background: var(--card-bg);
    border: var(--border-width) solid var(--card-border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    background: var(--primary-color);
    color: var(--btn-text-color);
    border-color: var(--primary-color);
}

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

.public-content {
    flex: 1;
    padding: 2rem;
}

.public-footer {
    background: var(--card-bg);
    border-top: var(--border-width) solid var(--card-border-color);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-small);
}

.landing-hero {
    max-width: 800px;
    margin: 4rem auto;
    text-align: center;
    padding: 0 2rem;
}

.landing-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--heading-color);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-features {
    max-width: 1200px;
    margin: 4rem auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.feature-card {
    background: var(--card-bg);
    border: var(--border-width) solid var(--card-border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    color: var(--primary-color);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-card h3 {
    font-size: var(--font-size-h3);
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.landing-cta {
    max-width: 800px;
    margin: 4rem auto;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-bg);
    border: var(--border-width) solid var(--card-border-color);
    border-radius: var(--border-radius);
}

.landing-cta h2 {
    font-size: var(--font-size-h1);
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.landing-cta p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.page-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.page-container h2 {
    color: var(--heading-color);
    margin: 2rem 0 1rem;
}

.page-container p, 
.page-container li {
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .public-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .public-nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .landing-hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ========================================
   PAGE CONTENT EDITOR (Admin)
   ======================================== */
.page-content-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    border-bottom: var(--border-width) solid var(--card-border-color);
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    border: var(--border-width) solid var(--card-border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--font-size-small);
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(0, 212, 170, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--btn-text-color);
}

.page-sections-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.page-section-item {
    background: rgba(0, 0, 0, 0.1);
    border: var(--border-width) solid var(--card-border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
}

[data-theme="light"] .page-section-item {
    background: rgba(0, 0, 0, 0.03);
}

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

.section-label {
    font-weight: 600;
    color: var(--heading-color);
    font-size: var(--font-size-base);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-small);
    color: var(--text-muted);
    cursor: pointer;
}

.toggle-inline input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.section-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-fields .form-group {
    margin-bottom: 0;
}

.section-fields label {
    font-size: var(--font-size-small);
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* ========================================
   PAGE BUILDER - DRAG & DROP
   ======================================== */
.page-builder-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    min-height: 700px;
    align-items: stretch;
}

.page-builder-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.page-builder-sidebar .card {
    flex-shrink: 0;
}

.page-builder-sidebar .card:first-child .card-body {
    max-height: none;
    overflow-y: visible;
    padding: 0.5rem;
}

.page-builder-main {
    min-height: 500px;
}

/* Content/Preview tab system */
.builder-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--card-border-color);
    padding-bottom: 0.5rem;
}

.builder-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-purple));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
}

.builder-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.5);
}

.builder-tab-btn.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.5);
}

.builder-tab-btn svg {
    width: 18px;
    height: 18px;
}

.builder-tab-content {
    display: none;
}

.builder-tab-content.active {
    display: block;
}

/* Live Preview Popup Overlay */
.preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
    flex-direction: column;
}

.preview-overlay.show {
    display: flex;
}

.preview-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-teal);
}

.preview-overlay-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
}

.preview-close-btn {
    width: 44px;
    height: 44px;
    background: var(--accent-coral);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.preview-close-btn:hover {
    transform: scale(1.1);
    background: #ff4444;
}

.preview-overlay-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.preview-overlay iframe {
    flex: 1;
    width: 100%;
    border: none;
    border-radius: var(--border-radius);
    background: #fff;
}

.preview-page-label {
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    color: var(--text-muted);
    text-align: center;
    font-size: 0.875rem;
    margin-top: 1rem;
    border-radius: var(--border-radius-sm);
}

@media (max-width: 1200px) {
    .page-builder-container {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 900px) {
    .page-builder-container {
        grid-template-columns: 180px 1fr;
        gap: 1rem;
    }
    
    .page-tab-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .page-tab-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .section-template {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .page-builder-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .page-builder-sidebar {
        position: relative;
        top: auto;
        max-height: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .page-builder-sidebar .card {
        margin-top: 0 !important;
    }
    
    .page-tabs-vertical {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .section-templates {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .section-template {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 100px;
    }
    
    .page-builder-main .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-builder-main .btn-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .page-builder-main .btn-group .btn {
        flex: 1;
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .builder-instructions {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .page-builder-sidebar {
        grid-template-columns: 1fr;
    }
    
    .page-tabs-vertical {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        max-height: none;
    }
    
    .page-tab-btn {
        flex-direction: column;
        padding: 0.5rem 0.25rem;
        text-align: center;
    }
    
    .page-tab-btn span {
        font-size: 0.625rem;
    }
    
    .section-templates {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .section-template {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem 0.25rem;
    }
    
    .section-template span {
        font-size: 0.625rem;
    }
    
    .page-builder-main .btn-group {
        flex-wrap: wrap;
    }
    
    .page-builder-main .btn-group .btn {
        flex: 1 1 calc(50% - 0.25rem);
    }
}

.page-tabs-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

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

.page-tab-btn:hover {
    background: rgba(0, 212, 170, 0.1);
    color: var(--heading-color);
}

.page-tab-btn.active {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-teal);
}

.section-templates {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-template {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.8125rem;
    cursor: grab;
    transition: all 0.2s ease;
}

.section-template svg {
    width: 16px;
    height: 16px;
    color: var(--accent-teal);
}

.section-template:hover {
    background: rgba(0, 212, 170, 0.1);
    border-color: var(--accent-teal);
    color: var(--heading-color);
}

.section-template:active {
    cursor: grabbing;
}

.builder-instructions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.builder-instructions .drag-icon svg {
    width: 16px;
    height: 16px;
    color: var(--accent-teal);
}

.page-sections-dropzone {
    min-height: 300px;
    background: rgba(255, 255, 255, 0.01);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all 0.2s ease;
}

.page-sections-dropzone.drag-over {
    border-color: var(--accent-teal);
    background: rgba(0, 212, 170, 0.05);
}

.empty-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    text-align: center;
}

.draggable-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all 0.2s ease;
}

.draggable-section:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.draggable-section.inactive {
    opacity: 0.5;
}

.draggable-section.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.draggable-section.drag-over-top {
    border-top: 2px solid var(--accent-teal);
    margin-top: -1px;
}

.draggable-section.drag-over-bottom {
    border-bottom: 2px solid var(--accent-teal);
    margin-bottom: -1px;
}

/* Section block styles for grouped sections */
.draggable-section.section-block {
    background: rgba(0, 212, 170, 0.05);
    border: 2px solid rgba(0, 212, 170, 0.2);
}

.draggable-section.section-block:hover {
    border-color: rgba(0, 212, 170, 0.4);
    background: rgba(0, 212, 170, 0.08);
}

.draggable-section.section-block.has-inactive {
    border-left: 3px solid rgba(255, 193, 7, 0.5);
}

.toggle-block-expand {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.toggle-block-expand:hover {
    color: var(--accent-teal);
}

.toggle-block-expand.expanded {
    transform: rotate(180deg);
}

.toggle-block-expand svg {
    width: 16px;
    height: 16px;
}

.section-block-children {
    margin-left: 2rem;
    margin-bottom: 0.5rem;
    border-left: 2px solid var(--gray-600);
    padding-left: 1rem;
}

.draggable-subsection {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    margin-bottom: 0.375rem;
    transition: all 0.2s ease;
}

.draggable-subsection:hover {
    background: rgba(255, 255, 255, 0.04);
}

.draggable-subsection.inactive {
    opacity: 0.5;
}

.draggable-subsection .section-icon {
    width: 28px;
    height: 28px;
}

.draggable-subsection .section-name {
    font-size: 0.8125rem;
}

.draggable-subsection .section-preview {
    font-size: 0.6875rem;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding: 0.25rem;
}

.drag-handle svg {
    width: 16px;
    height: 16px;
}

.drag-handle:active {
    cursor: grabbing;
}

.section-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 170, 0.1);
    border-radius: var(--radius);
    color: var(--accent-teal);
}

.section-icon svg {
    width: 18px;
    height: 18px;
}

.section-info {
    flex: 1;
    min-width: 0;
}

.section-name {
    font-weight: 600;
    color: var(--heading-color);
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.section-preview {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-small {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-small input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-small input:checked + .toggle-slider {
    background-color: var(--accent-teal);
}

.toggle-small input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.btn-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon svg {
    width: 14px;
    height: 14px;
}

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

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

#save-page-order {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#save-page-order svg {
    width: 16px;
    height: 16px;
}

#save-page-order.has-changes {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.preview-frame-container {
    background: #fff;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

[data-theme="light"] .page-builder-container .card {
    background: #ffffff;
}

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

[data-theme="light"] .page-sections-dropzone {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .draggable-section {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

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

/* ========================================
   COMPREHENSIVE MOBILE RESPONSIVENESS
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 260px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .topbar {
        padding: 1rem;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-nav {
        padding: 1rem;
    }
}

/* Mobile (up to 768px) */
@media (max-width: 768px) {
    /* Navigation */
    .public-nav {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .public-nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .public-nav-links a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Hero Section */
    .landing-hero {
        padding: 3rem 1rem;
        min-height: auto;
    }
    
    .landing-hero h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9375rem;
        padding: 0 0.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        padding: 0 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Features Grid */
    .landing-features {
        padding: 2rem 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1.25rem;
    }
    
    /* Stats */
    .landing-stats {
        padding: 2rem 1rem;
    }
    
    .stats-grid,
    .landing-stats .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* CTA Section */
    .landing-cta {
        padding: 2rem 1rem;
    }
    
    .landing-cta h2 {
        font-size: 1.5rem;
    }
    
    /* Cards */
    .card {
        border-radius: var(--border-radius);
    }
    
    .card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Dashboard Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Tables - Convert to card layout on mobile */
    .data-table thead {
        display: none;
    }
    
    .data-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--card-border-color);
        gap: 0.5rem;
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        padding: 0.25rem 0;
        border: none;
    }
    
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input,
    .form-select {
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Modals */
    .modal {
        margin: 1rem;
        max-width: calc(100% - 2rem) !important;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column-reverse;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Grid layouts */
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    /* Page Content */
    .page-content {
        padding: 1rem;
    }
    
    /* Topbar */
    .topbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Auth Pages */
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        max-width: 100%;
    }
    
    .auth-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .auth-body {
        padding: 1rem;
    }
    
    /* Admin Specific */
    .admin-topbar {
        padding: 0.75rem 1rem;
    }
    
    .admin-nav-links {
        display: none;
    }
    
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    /* Draggable sections */
    .draggable-section {
        padding: 0.75rem;
    }
    
    .section-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .section-controls {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Leaderboard */
    .leaderboard-table td,
    .leaderboard-table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Footer */
    .public-footer {
        padding: 2rem 1rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .landing-hero h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .hero-buttons {
        padding: 0;
    }
    
    .public-nav-links {
        gap: 0.25rem;
    }
    
    .public-nav-links a {
        padding: 0.4rem 0.6rem;
        font-size: 0.8125rem;
    }
    
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .page-content-tabs {
        gap: 0.25rem;
    }
}

/* Mobile Menu Button (hidden by default, shown on mobile) */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--card-border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    cursor: pointer;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
    .btn, 
    .tab-btn,
    .nav-link,
    .public-nav-links a {
        min-height: 44px;
    }
    
    .form-input,
    .form-select {
        min-height: 44px;
    }
    
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }
}
