/* Gaming Interface Styles */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #ff6b6b;
    --accent-color: #4ecdc4;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --border-color: #333;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.6);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-dark);
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    opacity: 0.1;
    animation: float 15s infinite linear;
}

.shape-1 { width: 80px; height: 80px; top: 10%; left: 10%; animation-delay: 0s; }
.shape-2 { width: 120px; height: 120px; top: 20%; right: 10%; animation-delay: 3s; }
.shape-3 { width: 60px; height: 60px; top: 60%; left: 20%; animation-delay: 6s; }
.shape-4 { width: 100px; height: 100px; bottom: 10%; right: 20%; animation-delay: 9s; }
.shape-5 { width: 70px; height: 70px; bottom: 30%; left: 50%; animation-delay: 12s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(-40px) rotate(180deg); }
    75% { transform: translateY(-20px) rotate(270deg); }
}

/* Header */
.header {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo-text h1 {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 500;
}

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

/* Main Content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Welcome Section */
.welcome-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 70vh;
}

.welcome-title {
    font-family: 'Orbitron', monospace;
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.stat-number {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #0099cc);
    color: white;
    box-shadow: var(--shadow);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

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

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

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

/* Console Showcase */
.console-showcase {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
}

.console-item {
    position: relative;
    animation: floatConsole 6s infinite ease-in-out;
}

.console-item:nth-child(2) { animation-delay: 2s; }
.console-item:nth-child(3) { animation-delay: 4s; }

@keyframes floatConsole {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.nes {
    width: 120px;
    height: 80px;
}

.console-screen {
    background: #222;
    border: 3px solid #666;
    border-radius: 4px;
    height: 40px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.console-screen::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    top: 50%;
    animation: scanline 2s infinite;
}

@keyframes scanline {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.console-body {
    background: #ccc;
    height: 30px;
    border-radius: 4px;
    position: relative;
}

.console-body::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--secondary-color);
    border-radius: 50%;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
}

.gameboy {
    width: 80px;
    height: 120px;
    background: #8BAC0F;
    border-radius: 8px;
    padding: 10px;
}

.gameboy-screen {
    background: #9BBD0F;
    height: 60px;
    border: 2px solid #306230;
    border-radius: 4px;
    margin-bottom: 10px;
}

.gameboy-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    height: 40px;
}

.gameboy-controls::before,
.gameboy-controls::after {
    content: '';
    background: #0F380F;
    border-radius: 50%;
    width: 15px;
    height: 15px;
}

.controller {
    width: 100px;
    height: 60px;
}

.controller-body {
    background: #444;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

.dpad {
    width: 20px;
    height: 20px;
    background: #222;
    position: relative;
}

.dpad::before,
.dpad::after {
    content: '';
    position: absolute;
    background: #666;
}

.dpad::before {
    width: 100%;
    height: 6px;
    top: 50%;
    transform: translateY(-50%);
}

.dpad::after {
    height: 100%;
    width: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.buttons {
    display: flex;
    gap: 5px;
}

.button-a,
.button-b {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--secondary-color);
}

.button-b {
    background: var(--primary-color);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.section-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.filter-select,
.search-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
}

.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.search-input {
    min-width: 300px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.game-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.game-system {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.game-size {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.game-play-btn {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.game-play-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
}

/* Systems Grid */
.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.system-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.system-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.system-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
}

.system-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.system-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.system-core {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-family: 'Orbitron', monospace;
}

.system-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.system-extensions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.extension-tag {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.control-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    transition: var(--transition);
}

.control-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--accent-color);
}

.control-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.control-card h3 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.control-mapping {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.1);
}

.key {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Orbitron', monospace;
}

.action {
    color: var(--text-light);
    font-weight: 500;
}

.control-info {
    color: var(--text-muted);
    line-height: 1.6;
}

.control-info ul {
    margin-top: 1rem;
    padding-left: 1rem;
}

.control-info li {
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--text-light);
    font-family: 'Orbitron', monospace;
}

.modal-controls {
    display: flex;
    gap: 1rem;
}

.modal-body {
    padding: 1.5rem;
}

.game-container {
    width: 100%;
    height: 600px;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.game-container iframe {
    width: 100%;
    height: 100%;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-stats {
    display: flex;
    gap: 2rem;
    color: var(--text-muted);
}

.game-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-light);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .section-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .search-input {
        min-width: 250px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .game-container {
        height: 400px;
    }
    
    .game-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .games-grid,
    .systems-grid {
        grid-template-columns: 1fr;
    }
    
    .game-container {
        height: 300px;
    }
}
