/* Enhanced Modern Styling */
:root {
    --primary-blue: #2563eb;
    --secondary-gray: #6b7280;
    --dark-bg: #1f2937;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
body {
    background: var(--gradient-bg);
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
}
#hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.5)), var(--gradient-bg);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 0;
    width: 100%;
    height: 20vh;
    background-size: cover;
    position: relative;
}
#hero:before {
    content: "";
    background: rgba(45, 53, 69, 0.7);
    position: absolute;
    bottom: 0;
    top: 0;
    left: 0;
    right: 0;
    z-index: 0; /* Make sure overlay is behind content */
}
#hero .container {
    text-align: center;
    padding-top: 5px;
    position: relative;
    z-index: 1; /* Add z-index to be above overlay */
}
#hero h1 {
    color: white !important;
    position: relative;
    z-index: 2;
    pointer-events: auto; /* Ensure text is clickable */
}
@media (max-width: 992px) {
    #hero .container {
        padding-top: 0;
    }
}
@media (min-width: 1024px) {
    #hero {
        background-attachment: fixed;
    }
}
@media (max-width: 768px) {
    #hero {
        height: 8vh;
    }
    #hero h1,
    #hero .container h1,
    section#hero h1 {
        font-size: 2rem !important;
        line-height: 1.2;
        color: #ffffff !important; /* Force white on mobile too */
    }
    #hero h2 {
        font-size: 18px;
        line-height: 22px;
    }
}

/* Better container width for large screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}

/* Enhanced Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}
.card-header {
    background: linear-gradient(135deg, #1f2937, #111827) !important;
    color: white !important;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-bottom: 3px solid #3b82f6;
    position: relative;
    display: flex;
    align-items: center;
}
.card-header i {
    margin-right: 0.5rem;
}
.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), #10b981);
}
.card-body {
    padding: 1.5rem;
}

/* Game Info Card Enhancements */
.game-info-card {
    transition: all 0.3s ease;
}
.game-info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}
.game-info-card .card-img-top {
    border-radius: 12px;
    margin: 1rem;
    width: calc(100% - 2rem);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.game-info-card .card-img-top:hover {
    transform: scale(1.02);
}
.game-detail-row {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}
.game-detail-row:last-child {
    border-bottom: none;
}
.game-detail-label {
    font-weight: 600;
    color: var(--secondary-gray);
    min-width: 80px;
    margin-right: 1rem;
}
.game-detail-value {
    flex: 1;
    color: #374151;
}

/* Badge Styling */
.badge {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.bg-success { background: linear-gradient(45deg, #10b981, #059669) !important; }
.bg-warning { background: linear-gradient(45deg, #f59e0b, #d97706) !important; }
.bg-info { background: linear-gradient(45deg, #3b82f6, #2563eb) !important; }

/* Control Button Enhancements */
.button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    margin-top: 1rem;
}
/* Make buttons smaller if needed */
.button-container button,
.button-container .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-width: 0;
    white-space: nowrap;
    border: none;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.button-container .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.icon-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--secondary-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.icon-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    background: white;
    color: var(--primary-blue);
}
.icon-button:active {
    transform: translateY(0);
}

/* Compact Card for Joystick Controls */
.compact-card {
    max-width: 100%;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.compact-card .card-body {
    padding: 1.25rem;
}
.compact-card h6 {
    color: var(--dark-bg);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.compact-card ul {
    margin-bottom: 1rem;
}
.compact-card li {
    padding: 0.25rem 0;
    font-size: 0.85rem;
    color: #4b5563;
}

/* Start Game Button */
.start-game-btn,
#show-emulator-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.start-game-btn:hover,
#show-emulator-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #047857);
}

/* Canvas Container */
#canvas_container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    background: #000;
}
#canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Progress Bar */
#progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    appearance: none;
    background: #e5e7eb;
    overflow: hidden;
}
#progress::-webkit-progress-bar {
    background: #e5e7eb;
    border-radius: 4px;
}
#progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--primary-blue), #10b981);
    border-radius: 4px;
}

/* Other Titles Section - Enhanced for inline styles */
.other-titles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.other-title-item {
    text-align: center;
    transition: transform 0.3s ease;
}
.other-title-item:hover {
    transform: translateY(-4px);
}
.other-title-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.other-title-item:hover img {
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.other-title-item p {
    margin: 0.75rem 0 0 0;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Better "Other Titles" styling - Works with inline styles */
div[style*="display: flex"][style*="justify-content: space-between"] {
    display: flex !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 1.5rem !important;
}

/* Style the flex items inside Other Titles */
div[style*="display: flex"][style*="justify-content: space-between"] > div {
    flex: 1 1 calc(25% - 1.5rem) !important;
    text-align: center !important;
    margin-bottom: 1rem !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect for Other Titles items */
div[style*="display: flex"][style*="justify-content: space-between"] > div:hover {
    transform: translateY(-8px);
}

/* Better image styling in Other Titles */
div[style*="display: flex"][style*="justify-content: space-between"] img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    transition: all 0.3s ease !important;
}

div[style*="display: flex"][style*="justify-content: space-between"] img:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
    transform: scale(1.05);
}

/* Better text styling in Other Titles */
div[style*="display: flex"][style*="justify-content: space-between"] p {
    margin: 0.75rem 0 0 0 !important;
    color: #fff !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Card with dark background improvements */
div.card-body[style*="background-color: #565658"] {
    background: linear-gradient(135deg, #565658, #4a4a4c) !important;
    padding: 1.5rem !important;
}

/* Better card width for Other Titles section on large screens */
@media (min-width: 1920px) {
    div.card[style*="max-width: 600px"] {
        max-width: 800px !important;
    }
}

/* SID Player Card */
.sid-player-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}
.sid-player-card .btn-group .btn {
    border-radius: 8px;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}
.sid-player-card .btn-group .btn:hover {
    transform: translateY(-1px);
}

/* Loading Animation */
#status {
    text-align: center;
    color: white;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Keyboard Button Enhancement */
.keyboardInput {
    background: linear-gradient(135deg, #374151, #1f2937) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.90rem 1.5rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}
.keyboardInput:hover {
    background: linear-gradient(135deg, #1f2937, #111827) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

/* Similar Games section improvements */
.card .row.g-3 .col-lg-2,
.card .row.g-3 .col-md-3,
.card .row.g-3 .col-sm-4 {
    transition: transform 0.3s ease;
}

.card .row.g-3 .col-lg-2:hover,
.card .row.g-3 .col-md-3:hover,
.card .row.g-3 .col-sm-4:hover {
    transform: translateY(-4px);
}

/* Better spacing for large screens */
@media (min-width: 1920px) {
    .col-lg-4 {
        padding-right: 2rem;
    }
    
    .col-lg-8 {
        padding-left: 2rem;
    }
    
    .card {
        margin-bottom: 2rem;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h5.card-title {
        font-size: 1.5rem;
    }
    
    .card-body {
        font-size: 1rem;
    }
}

/* Better table styling if present */
table {
    width: 100%;
}

table tr:hover {
    background: rgba(0,0,0,0.02);
}

table.table td,
table.table th {
    padding: 0.75rem;
}

/* Smooth animations for all interactive elements */
button,
.btn,
a,
.card {
    transition: all 0.3s ease;
}

/* Better link colors on cards */
.card a {
    transition: all 0.3s ease;
}

.card a:hover {
    opacity: 0.8;
}

/* Small visual polish */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Better text readability on cards */
.card-body p,
.card-body span,
.card-body div {
    line-height: 1.6;
}

a {
    color: #141261;
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Raleway", sans-serif;
}

/*--------------------------------------------------------------
# Navigation Menu
--------------------------------------------------------------*/
/**
* Desktop Navigation 
*/
.navbar {
    padding: 0;
}
.navbar ul {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
    align-items: center;
}
.navbar li {
    position: relative;
}
.navbar a,
.navbar a:focus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 10px 30px;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    transition: 0.3s;
}
.navbar a i,
.navbar a:focus i {
    font-size: 12px;
    line-height: 0;
    margin-left: 5px;
}
.navbar a:hover,
.navbar .active,
.navbar .active:focus,
.navbar li:hover>a {
    color: #ffc107;
}
.navbar .dropdown ul {
    display: block;
    position: absolute;
    left: 14px;
    top: calc(100% + 30px);
    margin: 0;
    padding: 10px 0;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    background: #fff;
    box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
    transition: 0.3s;
}
.navbar .dropdown ul li {
    min-width: 200px;
}
.navbar .dropdown ul a {
    padding: 10px 20px;
    font-size: 14px;
    text-transform: none;
    color: #414c64;
}
.navbar .dropdown ul a i {
    font-size: 12px;
}
.navbar .dropdown ul a:hover,
.navbar .dropdown ul .active:hover,
.navbar .dropdown ul li:hover>a {
    color: #ffc107;
}
.navbar .dropdown:hover>ul {
    opacity: 1;
    top: 100%;
    visibility: visible;
}
.navbar .dropdown .dropdown ul {
    top: 0;
    left: calc(100% - 30px);
    visibility: hidden;
}
.navbar .dropdown .dropdown:hover>ul {
    opacity: 1;
    top: 0;
    left: 100%;
    visibility: visible;
}
@media (max-width: 1366px) {
    .navbar .dropdown .dropdown ul {
        left: -90%;
    }
    .navbar .dropdown .dropdown:hover>ul {
        left: -100%;
    }
}

/**
* Mobile Navigation 
*/
.mobile-nav-toggle {
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: none;
    line-height: 0;
    transition: 0.5s;
}
@media (max-width: 991px) {
    .mobile-nav-toggle {
        display: block;
    }
    .navbar ul {
        display: none;
    }
}
.navbar-mobile {
    position: fixed;
    overflow: hidden;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(45, 53, 69, 0.9);
    transition: 0.3s;
    z-index: 999;
}
.navbar-mobile .mobile-nav-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
}
.navbar-mobile ul {
    display: block;
    position: absolute;
    top: 55px;
    right: 15px;
    bottom: 15px;
    left: 15px;
    padding: 10px 0;
    background-color: #fff;
    overflow-y: auto;
    transition: 0.3s;
}
.navbar-mobile a,
.navbar-mobile a:focus {
    padding: 10px 20px;
    font-size: 15px;
    color: #414c64;
}
.navbar-mobile a:hover,
.navbar-mobile .active,
.navbar-mobile li:hover>a {
    color: #ffc107;
}
.navbar-mobile .dropdown ul {
    position: static;
    display: none;
    margin: 10px 20px;
    padding: 10px 0;
    z-index: 99;
    opacity: 1;
    visibility: visible;
    background: #fff;
    box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
}
.navbar-mobile .dropdown ul li {
    min-width: 200px;
}
.navbar-mobile .dropdown ul a {
    padding: 10px 20px;
}
.navbar-mobile .dropdown ul a i {
    font-size: 12px;
}
.navbar-mobile .dropdown ul a:hover,
.navbar-mobile .dropdown ul .active:hover,
.navbar-mobile .dropdown ul li:hover>a {
    color: #ffc107;
}
.navbar-mobile .dropdown>.dropdown-active {
    display: block;
}

/*--------------------------------------------------------------
# Sections General
--------------------------------------------------------------*/
section {
    padding: 60px 0;
}
.section-bg {
    background-color: #B7BAC1;
}
.section-title {
    text-align: center;
    padding-bottom: 30px;
}
.section-title h2 {
    font-size: 32px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 20px;
    position: relative;
}
.section-title h2::after {
    content: "";
    position: absolute;
    display: block;
    width: 50px;
    height: 3px;
    background: #ffc107;
    bottom: 0;
    left: calc(50% - 25px);
}
.section-title p {
    margin-bottom: 0;
    font-size: 14px;
    color: #aab3c7;
}
#footer {
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: #444c6e;
    color: white;
    text-align: center;
}
