/* CSS Variables for theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.3);
    
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --accent-color: #764ba2;
    
    --header-bg: #ffffff;
    --footer-bg: #1e293b;
    --footer-text: #ffffff;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    --border-color: #334155;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.7);
    
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #8b5cf6;
    
    --header-bg: #1e293b;
    --footer-bg: #0f172a;
    --footer-text: #f1f5f9;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 1001;
}

.theme-switcher:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

.theme-switcher svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Header and Navigation */
.header {
    background: var(--header-bg);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    height: 50px;
    width: 50px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-auth {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.nav-auth-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 32px;
    height: 32px;
    animation: rotate 2s linear infinite;
}

.spinner-path {
    stroke: var(--primary-color);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.nav-user-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    text-align: right;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    gap: 8px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #2563eb;
}

.btn-discord {
    background: #5865f2;
    color: white;
}

.btn-discord:hover {
    background: #4752c4;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.hero-logo {
    width: 280px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    justify-self: end;
}

.preview-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Sections */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-primary);
}

.about {
    padding: 100px 0;
    background: var(--bg-primary);
}

.about-preview {
    max-width: 80%;
    margin: 0 auto 60px;
}

@media (max-width: 1920px) {
    .about-preview {
        max-width: 80%;
    }
}

@media (max-width: 1200px) {
    .about-preview {
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    .about-preview {
        max-width: 95%;
    }
}

.about-preview-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: block;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    background: var(--bg-card-hover);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Downloads Section */
.downloads {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.download-card {
    background: var(--bg-card);
    padding: 50px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.download-card h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.download-card p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.note {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.auth-container {
    margin-top: 30px;
}

.discord-icon {
    width: 20px;
    height: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-discriminator {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.download-list {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.download-item:last-child {
    margin-bottom: 0;
}

.download-info h5 {
    margin-bottom: 5px;
    color: var(--text-primary);
}

.download-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.access-denied {
    background: #fef2f2;
    color: #dc2626;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.access-denied p {
    margin-bottom: 10px;
    color: #dc2626;
}

.access-denied p:last-child {
    margin-bottom: 0;
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: var(--bg-primary);
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 50px 0;
    transition: background-color 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.footer-logo {
    height: 60px;
    width: 60px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.footer-section h4 {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--footer-text);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .download-card {
        padding: 30px 20px;
        margin: 0 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
    
    .download-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
    }
    
    .user-details {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Downloads Page */
.downloads-page {
    padding: 120px 0 80px;
    min-height: calc(100vh - 70px);
}

.page-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.user-info-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.user-info-card .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info-card .user-avatar {
    width: 60px;
    height: 60px;
}

#download-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}