/* Theme Variables */
:root {
    --theme-transition: all 0.3s ease;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .navbar {
    background: rgba(248, 249, 250, 0.95);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

[data-theme="light"] .hero-background {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="minecraft-light" patternUnits="userSpaceOnUse" width="20" height="20"><rect width="20" height="20" fill="%23f8f9fa"/><rect width="10" height="10" fill="%23e9ecef"/><rect x="10" y="10" width="10" height="10" fill="%23e9ecef"/></pattern></defs><rect width="100" height="100" fill="url(%23minecraft-light)" opacity="0.3"/></svg>');
}

[data-theme="light"] .modal-content {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .popup-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] .social-links a {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

[data-theme="light"] .nav-menu {
    background-color: var(--bg-primary);
}

/* Dark Theme (Default) */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #888888;
    
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--theme-transition);
    z-index: 1000;
    box-shadow: var(--box-shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
}

.theme-toggle i {
    transition: var(--theme-transition);
}

/* Theme specific icons */
[data-theme="light"] .theme-toggle .fa-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

/* Smooth transitions for theme changes */
*,
*::before,
*::after {
    transition: background-color var(--theme-transition), 
                color var(--theme-transition), 
                border-color var(--theme-transition),
                box-shadow var(--theme-transition);
}

/* Override transitions for animations that shouldn't be affected */
.hero-title,
.loading,
.modal-content {
    transition: background-color var(--theme-transition), 
                color var(--theme-transition), 
                border-color var(--theme-transition),
                box-shadow var(--theme-transition),
                transform 0.3s ease,
                opacity 0.3s ease;
}

/* Theme specific adjustments */
[data-theme="light"] .hero-title {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .feature-card:hover,
[data-theme="light"] .news-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Custom scrollbar for different themes */
[data-theme="light"] ::-webkit-scrollbar {
    width: 8px;
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}