:root {
    --primary-color: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary-color: #8B5CF6;
    --accent-color: #FFFFFF;
    --background-color: #F8FAFC;
    --background-gradient: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    --text-color: #1F2937;
    --text-light: #6B7280;
    --correct-color: #10B981;
    --wrong-color: #EF4444;
    --success-color: #22C55E;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --card-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.navbar {
    background: var(--background-gradient);
    box-shadow: var(--card-shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 250ms ease-in-out;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    color: var(--accent-color) !important;
    text-decoration: none;
    transition: transform 250ms ease-in-out;
}

.navbar-brand:hover {
    transform: scale(1.05);
    color: var(--accent-color) !important;
}

.navbar-brand img {
    height: 55px;
    width: auto;
    transition: transform 250ms ease-in-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4)) brightness(1.2);
    padding: 5px;
}

.navbar-brand:hover img {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)) brightness(1.3);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem;
    transition: all 250ms ease-in-out;
    color: rgba(255, 255, 255, 0.9) !important;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 250ms ease-in-out;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    width: 100%;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    transition: all 250ms ease-in-out;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.game-card {
    transition: all 350ms ease-in-out;
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    background-color: var(--accent-color);
    box-shadow: var(--card-shadow);
    position: relative;
    animation: fadeInUp 0.6s ease-out;
}

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

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--card-shadow-lg);
}

.game-card-img {
    height: 200px;
    object-fit: cover;
    width: 100%;
    transition: transform 350ms ease-in-out;
}

.game-card:hover .game-card-img {
    transform: scale(1.1);
}

.game-card-img-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.game-card-title {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1.25rem;
}

.game-card-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.btn-primary {
    background: var(--background-gradient);
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    transition: all 250ms ease-in-out;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    transition: all 250ms ease-in-out;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

main {
    flex: 1;
    padding: 3rem 0;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.display-4 {
    background: var(--background-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

footer {
    background: var(--background-gradient);
    color: var(--accent-color);
    padding: 2rem 0;
    margin-top: auto;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.05);
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.dropdown-menu {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow-hover);
    padding: 0.5rem 0;
    background-color: var(--accent-color);
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 0.5rem 1.25rem;
    color: var(--text-color);
    transition: all 150ms ease-in-out;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--background-gradient);
    color: var(--accent-color);
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
}

.alert {
    border-radius: 0.75rem;
    border: none;
    box-shadow: var(--card-shadow);
    padding: 1rem;
    animation: slideInRight 0.3s ease-out;
}

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

.alert-info {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: var(--primary-dark);
}

.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: all 250ms ease-in-out;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

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

.page-link {
    border-radius: 0.5rem;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    transition: all 250ms ease-in-out;
}

.page-link:hover {
    background: var(--background-gradient);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.page-item.active .page-link {
    background: var(--background-gradient);
    border-color: var(--primary-color);
}

@media (max-width: 575.98px) {
    body {
        font-size: 14px;
    }

    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand img {
        height: 35px;
    }

    .display-4 {
        font-size: 1.75rem;
    }

    main {
        padding: 1.5rem 0;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .game-card-img {
        height: 160px;
    }

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

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .game-card-img {
        height: 180px;
    }

    .display-4 {
        font-size: 2rem;
    }

    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 992px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    main {
        padding: 3rem 0;
    }
}

@media (min-width: 1200px) {
    .game-card {
        transition: all 350ms ease-in-out;
    }

    .game-card:hover {
        transform: translateY(-15px) scale(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--background-gradient);
    color: var(--accent-color);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 250ms ease-in-out;
    box-shadow: var(--card-shadow-hover);
    z-index: 999;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-lg);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

/* Footer Links */
.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    transition: all 250ms ease-in-out;
    display: inline-block;
}

.footer-links a:hover {
    transform: translateY(-3px) scale(1.2);
    opacity: 0.8;
}

/* Additional Responsive Improvements */
@media (max-width: 575.98px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        bottom: 15px;
        right: 15px;
    }
    
    .footer-links a {
        font-size: 1.2rem;
    }
    
    .hero-stats {
        gap: 1rem !important;
    }
    
    .stat-item {
        font-size: 0.9rem;
    }
}

/* Hero Section */
.hero-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 2rem;
    margin-bottom: 3rem;
}

.hero-content {
    padding: 2rem 0;
}

.stat-item {
    padding: 1rem;
    border-radius: 1rem;
    background: white;
    box-shadow: var(--card-shadow);
    transition: all 250ms ease-in-out;
    min-width: 120px;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

@media (max-width: 767.98px) {
    .hero-stats {
        gap: 1rem;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 0.75rem;
    }
    
    .stat-icon {
        font-size: 2rem !important;
    }
    
    .stat-number {
        font-size: 1.25rem !important;
    }
    
    .hero-section {
        margin-bottom: 2rem;
        padding: 1.5rem 0;
    }
}
