/* CSS Variables for Dark & Light Themes */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #151b2d;
    --bg-card: rgba(21, 27, 45, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #a0a5b9;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --border-color: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Page Transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.page-container {
    animation: fadeIn 0.5s ease;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin: 1rem;
    position: sticky;
    top: 1rem;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.site-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

.balance-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.balance-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.balance-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Notice Scroll */
.notice-scroll {
    margin: 0 1rem 1rem;
    padding: 0.75rem 1rem;
    overflow: hidden;
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notice-icon {
    font-size: 1.25rem;
}

marquee {
    color: var(--text-primary);
}

/* Slider */
.slider-section {
    margin: 0 1rem 2rem;
}

.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-item {
    min-width: 100%;
    aspect-ratio: 16/9;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.slider-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--accent-primary);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-btn:hover {
    background: var(--accent-primary);
}

.slider-btn-prev { left: 1rem; }
.slider-btn-next { right: 1rem; }

/* Categories */
.categories-section {
    padding: 0 1rem 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-logo {
    width: 32px;
    height: 32px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

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

.category-card {
    text-decoration: none;
    color: var(--text-primary);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

.category-banner,
.category-banner-placeholder {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.category-banner-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    font-size: 3rem;
}

.category-info {
    padding: 1rem;
}

.category-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.match-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 0.75rem 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.nav-item.active {
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-label {
    font-size: 0.75rem;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--bg-primary);
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    animation: scaleIn 0.5s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-error {
    background: var(--error);
    color: white;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

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

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
        margin: 0.5rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .slider-btn {
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}
