/* ========================================
// CONTROLLER MENU STYLES
// ======================================== */

/* Controller Page Styles */
.controller-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

/* Controller Section for Home Page */
.controller-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px auto;
    max-width: 1000px;
    padding: 20px;
}

.controller-header {
    text-align: center;
    margin-bottom: 40px;
}

.controller-header h1 {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
}

.controller-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

/* Controller Body */
.game-controller {
    position: relative;
    width: 800px;
    height: 400px;
    background: radial-gradient(circle at 20% 20%, #ff0055 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #ffaa00 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, #00ffaa 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, #0055ff 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, #aa00ff 0%, transparent 50%),
                #1a1a1a;
    border-radius: 120px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
                inset 0 2px 10px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 60px;
    user-select: none;
}

.game-controller::before {
    content: '';
    position: absolute;
    inset: 16px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

/* D-Pad Area */
.d-pad-area {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-pad-base {
    position: relative;
    width: 128px;
    height: 128px;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 500px;
}

.d-pad-cross {
    position: relative;
    width: 96px;
    height: 96px;
    transition: transform 0.1s ease-out;
}

.d-pad-horizontal {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 32px;
    transform: translateY(-50%);
    background: #374151;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.6),
                inset 0 2px 2px rgba(255, 255, 255, 0.2);
}

.d-pad-vertical {
    position: absolute;
    top: 0;
    left: 50%;
    width: 32px;
    height: 100%;
    transform: translateX(-50%);
    background: #374151;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.6),
                inset 0 2px 2px rgba(255, 255, 255, 0.2);
}

.d-pad-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    background: #1f2937;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.d-pad-button {
    position: absolute;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
}

.d-pad-button:hover {
    background: rgba(255, 255, 255, 0.05);
}

.d-pad-button.active {
    background: rgba(255, 255, 255, 0.1);
}

.d-pad-button.up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px 4px 0 0;
}

.d-pad-button.down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 4px 4px;
}

.d-pad-button.left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-radius: 4px 0 0 4px;
}

.d-pad-button.right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    border-radius: 0 4px 4px 0;
}

/* D-Pad Arrows */
.d-pad-arrow {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.d-pad-arrow.up {
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid #6b7280;
}

.d-pad-arrow.down {
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #6b7280;
}

.d-pad-arrow.left {
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 6px solid #6b7280;
}

.d-pad-arrow.right {
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #6b7280;
}

/* Center Screen */
.controller-screen {
    position: relative;
    width: 360px;
    height: 260px;
    background: #111827;
    border-radius: 16px;
    border: 12px solid #000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
    overflow: hidden;
}

.crt-effect {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    z-index: 10;
    pointer-events: none;
    opacity: 0.5;
}

.screen-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #082f49;
    color: #22d3ee;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    z-index: 0;
}

.main-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.menu-item-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

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

.menu-icon {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.8));
}

.menu-title {
    font-size: 1.875rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
    text-align: center;
}

.menu-subtitle {
    font-size: 0.875rem;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0891b2;
    margin-top: 8px;
    text-align: center;
}

.screen-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #0891b2;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 20;
    padding: 8px;
}

.screen-nav-button:hover {
    color: #22d3ee;
}

.screen-nav-button.left {
    left: 16px;
}

.screen-nav-button.right {
    right: 16px;
}

.screen-dots {
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 20;
}

.screen-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    transition: all 0.2s;
}

.screen-dot.active {
    background: #22d3ee;
    box-shadow: 0 0 8px rgba(34, 211, 238, 1);
}

.screen-dot:hover {
    background: #0e7490;
}

.submenu {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.submenu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0e7490;
}

.submenu-back {
    background: transparent;
    border: none;
    color: #0891b2;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 20;
    padding: 4px;
}

.submenu-back:hover {
    color: #22d3ee;
}

.submenu-icon {
    width: 24px;
    height: 24px;
    color: #22d3ee;
}

.submenu-title {
    font-size: 1.25rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #22d3ee;
    text-shadow: 0 0 4px rgba(34, 211, 238, 0.5);
}

.submenu-items {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.submenu-list {
    position: absolute;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s ease-out;
}

.submenu-item {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-radius: 6px;
    text-align: left;
    transition: all 0.2s;
    cursor: pointer;
    z-index: 20;
    background: transparent;
    border: none;
    color: #0891b2;
    font-family: inherit;
    font-size: 14px;
}

.submenu-item:hover {
    background: rgba(14, 116, 144, 0.5);
}

.submenu-item.active {
    background: #22d3ee;
    color: #082f49;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

.submenu-item.active::before {
    content: '>';
    margin-right: 8px;
}

.submenu-controls {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #0e7490;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Action Buttons */
.action-buttons-area {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons-base {
    position: relative;
    width: 144px;
    height: 144px;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons-layout {
    position: relative;
    width: 112px;
    height: 112px;
}

.action-button {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #111827;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.1s;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5),
                inset 0 2px 4px rgba(255, 255, 255, 0.6),
                inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.action-button:hover {
    filter: brightness(1.1);
}

.action-button:active {
    transform: scale(0.9);
}

.action-button.y {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #eab308;
}

.action-button.y:active {
    background: #ca8a04;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8),
                inset 0 4px 6px rgba(0, 0, 0, 0.6),
                inset 0 -1px 2px rgba(255, 255, 255, 0.2);
}

.action-button.a {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
}

.action-button.a:active {
    background: #16a34a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8),
                inset 0 4px 6px rgba(0, 0, 0, 0.6),
                inset 0 -1px 2px rgba(255, 255, 255, 0.2);
}

.action-button.x {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: #3b82f6;
}

.action-button.x:active {
    background: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8),
                inset 0 4px 6px rgba(0, 0, 0, 0.6),
                inset 0 -1px 2px rgba(255, 255, 255, 0.2);
}

.action-button.b {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #ef4444;
}

.action-button.b:active {
    background: #dc2626;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8),
                inset 0 4px 6px rgba(0, 0, 0, 0.6),
                inset 0 -1px 2px rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 900px) {
    .game-controller {
        transform: scale(0.8);
        width: 640px;
        height: 320px;
    }
}

/* PlayStation Controller Theme */
.playstation-theme-controller {
    background: radial-gradient(circle at 20% 20%, #003791 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #003791 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, #003791 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, #003791 0%, transparent 50%),
                #1a1a1a;
    border: 2px solid #003791;
}

/* PlayStation Controller Buttons - Standard A|B|X|Y Layout */
.playstation-buttons .y {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #eab308;
}

.playstation-buttons .a {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
}

.playstation-buttons .x {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: #3b82f6;
}

.playstation-buttons .b {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #ef4444;
}

/* Xbox Controller Theme */
.xbox-theme-controller {
    background: radial-gradient(circle at 20% 20%, #107c10 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #107c10 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, #107c10 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, #107c10 0%, transparent 50%),
                #1a1a1a;
    border: 2px solid #107c10;
}

.xbox-buttons .a {
    background: #22c55e;
    color: white;
}

.xbox-buttons .b {
    background: #ef4444;
    color: white;
}

.xbox-buttons .x {
    background: #3b82f6;
    color: white;
}

.xbox-buttons .x:active {
    background: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8),
                inset 0 4px 6px rgba(0, 0, 0, 0.6),
                inset 0 -1px 2px rgba(255, 255, 255, 0.2);
}

.xbox-buttons .y {
    background: #eab308;
    color: white;
}

/* Nintendo Controller Theme */
.nintendo-theme-controller {
    background: radial-gradient(circle at 20% 20%, #e60012 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #e60012 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, #e60012 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, #e60012 0%, transparent 50%),
                #1a1a1a;
    border: 2px solid #e60012;
}

.nintendo-buttons .a {
    background: #22c55e;
    color: white;
}

.nintendo-buttons .b {
    background: #ef4444;
    color: white;
}

.nintendo-buttons .x {
    background: #3b82f6;
    color: white;
}

.nintendo-buttons .x:active {
    background: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8),
                inset 0 4px 6px rgba(0, 0, 0, 0.6),
                inset 0 -1px 2px rgba(255, 255, 255, 0.2);
}

.nintendo-buttons .y {
    background: #eab308;
    color: white;
}

/* Retro Controller Theme */
.retro-theme-controller {
    background: radial-gradient(circle at 20% 20%, #800020 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #800020 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, #800020 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, #800020 0%, transparent 50%),
                #2a2a2a;
    border: 2px solid #800020;
}

/* Retro Controller Buttons - Standard A|B|X|Y Layout */
.retro-buttons .y {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #eab308;
}

.retro-buttons .a {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
}

.retro-buttons .x {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: #3b82f6;
}

.retro-buttons .b {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #ef4444;
}

/* Screen Theme Variations */
.playstation-screen {
    border: 3px solid #003791;
    box-shadow: 0 0 20px rgba(0, 55, 145, 0.5);
}

.xbox-screen {
    border: 3px solid #107c10;
    box-shadow: 0 0 20px rgba(16, 124, 16, 0.5);
}

.nintendo-screen {
    border: 3px solid #e60012;
    box-shadow: 0 0 20px rgba(230, 0, 18, 0.5);
}

.retro-screen {
    border: 3px solid #800020;
    box-shadow: 0 0 20px rgba(128, 0, 32, 0.5);
}

@media (max-width: 700px) {
    /* Game Boy Advance Mobile Layout */
    .game-controller {
        transform: scale(0.8);
        width: 400px;
        height: 600px;
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .controller-screen-area {
        width: 100%;
        height: 200px;
        order: 1;
    }
    
    .controller-body {
        width: 100%;
        height: 250px;
        order: 2;
        flex-direction: row;
        gap: 20px;
        justify-content: space-between;
    }
    
    .left-grip, .right-grip {
        width: 120px;
        height: 100%;
    }
    
    .d-pad-area {
        width: 100%;
        height: 100%;
    }
    
    .action-buttons-area {
        width: 100%;
        height: 100%;
    }
    
    .controller-header {
        display: none;
    }
    
    /* Smaller buttons for mobile */
    .action-button {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .d-pad-button {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .controller-screen {
        width: 100%;
        height: 100%;
        font-size: 14px;
    }
    
    .screen-content {
        padding: 15px;
    }
    
    .main-menu {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .menu-item-display {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        opacity: 0;
        animation: fadeIn 0.3s ease-out forwards;
        text-align: center;
    }
    
    .menu-icon {
        width: 40px;
        height: 40px;
    }
    
    .menu-title {
        font-size: 1.2rem;
        text-align: center;
    }
    
    /* Mobile-specific adjustments for Game Boy Advance layout */
    .action-buttons-layout {
        width: 100px;
        height: 100px;
    }
    
    .d-pad-layout {
        width: 100px;
        height: 100px;
    }
    
    /* Ensure proper spacing for mobile layout */
    .left-grip {
        flex: 1;
    }
    
    .right-grip {
        flex: 1;
    }
}
