/* ==========================================================================
   Retro Style Switcher - Style RCCA Terminal / ASCII Art
   Adapté pour Retro Computing Club Adour
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&family=Share+Tech+Mono&display=swap');

.retro-switcher-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0;
    background: #0a0a0a;
    border: 3px solid #33ff33;
    box-shadow: 
        0 0 20px rgba(51, 255, 51, 0.3),
        inset 0 0 60px rgba(51, 255, 51, 0.05);
    font-family: 'VT323', 'Courier New', monospace;
    position: relative;
    overflow: hidden;
}

/* Effet scanlines */
.retro-switcher-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    z-index: 10;
}

/* Header du terminal */
.retro-switcher-container::after {
    content: "╔══════════════════════════════════════════════════════════════════════════════╗";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    color: #33ff33;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    text-align: center;
    letter-spacing: -1px;
    opacity: 0.5;
}

/* Titre style terminal */
.retro-switcher-title {
    text-align: center;
    color: #33ff33;
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    padding: 1.5rem 1rem 0.5rem;
    margin: 0;
    text-shadow: 0 0 10px rgba(51, 255, 51, 0.8);
    letter-spacing: 2px;
    position: relative;
    z-index: 5;
}

.retro-switcher-title::before {
    content: "*** ";
    color: #ffcc00;
}

.retro-switcher-title::after {
    content: " ***";
    color: #ffcc00;
}

/* Sous-titre */
.retro-switcher-subtitle {
    text-align: center;
    color: #aaaaaa;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    margin: 0.5rem 0 1.5rem;
    position: relative;
    z-index: 5;
}

/* Disposition en grille */
.retro-switcher-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0;
    padding: 1rem;
    position: relative;
    z-index: 5;
}

[data-layout="horizontal"] .retro-switcher-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

[data-layout="vertical"] .retro-switcher-options {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* Boutons de sélection - Style touches de clavier rétro */
.retro-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.8rem 1rem;
    margin: 0.3rem;
    border: 2px solid #444;
    border-radius: 0;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    position: relative;
    font-family: 'VT323', monospace;
}

.retro-option::before {
    content: "] ";
    color: #33ff33;
    font-family: 'Share Tech Mono', monospace;
    margin-right: 0.5rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.retro-option:hover::before,
.retro-option.active::before {
    opacity: 1;
}

.retro-option:hover {
    border-color: #33ff33;
    background: linear-gradient(180deg, #1a2a1a 0%, #0d150d 100%);
    box-shadow: 
        0 0 15px rgba(51, 255, 51, 0.4),
        inset 0 0 20px rgba(51, 255, 51, 0.1);
    transform: translateX(5px);
}

.retro-option.active {
    border-color: #33ff33;
    background: linear-gradient(180deg, #0d2a0d 0%, #001a00 100%);
    box-shadow: 
        0 0 20px rgba(51, 255, 51, 0.6),
        inset 0 0 30px rgba(51, 255, 51, 0.15);
}

.retro-option.active::after {
    content: " ◄";
    color: #33ff33;
    position: absolute;
    right: 1rem;
    animation: blink 1s infinite;
}

.retro-emoji {
    font-size: 1.8rem;
    margin-right: 1rem;
    filter: grayscale(20%);
}

.retro-name {
    color: #ffffff;
    font-weight: normal;
    font-size: 1.4rem;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.retro-desc {
    color: #888888;
    font-size: 1rem;
    font-family: 'VT323', monospace;
    margin-left: auto;
    padding-left: 1rem;
}

/* Styles spécifiques par machine avec couleurs caractéristiques */
.retro-option-commodore64:hover,
.retro-option-commodore64.active {
    border-color: #7878ff;
    box-shadow: 0 0 20px rgba(120, 120, 255, 0.5);
}
.retro-option-commodore64:hover::before,
.retro-option-commodore64.active::before {
    color: #7878ff;
}
.retro-option-commodore64 .retro-name {
    color: #7878ff;
}

.retro-option-amstrad:hover,
.retro-option-amstrad.active {
    border-color: #ffcc00;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
}
.retro-option-amstrad:hover::before,
.retro-option-amstrad.active::before {
    color: #ffcc00;
}
.retro-option-amstrad .retro-name {
    color: #ffcc00;
}

.retro-option-spectrum {
    border-image: linear-gradient(180deg, #ff0000, #ff7f00, #ffff00, #00ff00, #00ffff, #0000ff, #8b00ff) 1;
}
.retro-option-spectrum:hover,
.retro-option-spectrum.active {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}
.retro-option-spectrum .retro-name {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #00ffff, #0000ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.retro-option-apple2:hover,
.retro-option-apple2.active {
    border-color: #33ff33;
    box-shadow: 0 0 20px rgba(51, 255, 51, 0.5);
}
.retro-option-apple2 .retro-name {
    color: #33ff33;
    text-shadow: 0 0 8px rgba(51, 255, 51, 0.5);
}

.retro-option-thomson:hover,
.retro-option-thomson.active {
    border-color: #5555ff;
    box-shadow: 0 0 20px rgba(85, 85, 255, 0.5);
}
.retro-option-thomson:hover::before,
.retro-option-thomson.active::before {
    color: #5555ff;
}
.retro-option-thomson .retro-name {
    color: #5555ff;
}

/* Séparateur */
.retro-switcher-separator {
    text-align: center;
    color: #33ff33;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    padding: 0.5rem;
    opacity: 0.6;
    position: relative;
    z-index: 5;
}

/* Bouton par défaut - Style différent */
.retro-switcher-default {
    text-align: center;
    padding: 1rem 1rem 1.5rem;
    border-top: 1px dashed #333;
    margin-top: 0.5rem;
    position: relative;
    z-index: 5;
}

.retro-switcher-default::before {
    content: "*** OU BIEN ***";
    display: block;
    color: #ffcc00;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.retro-option-default {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: linear-gradient(180deg, #2a1a1a 0%, #1a0d0d 100%);
    border: 2px solid #ff6666;
    margin: 0;
}

.retro-option-default:hover {
    border-color: #ff9999;
    background: linear-gradient(180deg, #3a2020 0%, #2a1515 100%);
    box-shadow: 0 0 20px rgba(255, 102, 102, 0.4);
    transform: none;
}

.retro-option-default.active {
    background: linear-gradient(180deg, #4a2020 0%, #3a1515 100%);
    border-color: #ffaaaa;
}

.retro-option-default::before {
    content: "♥ ";
    color: #ff6666;
    opacity: 1;
}

.retro-option-default .retro-emoji {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.retro-option-default .retro-name {
    color: #ff9999;
    font-size: 1.2rem;
}

/* Footer du sélecteur */
.retro-switcher-footer {
    text-align: center;
    padding: 1rem;
    color: #33ff33;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    border-top: 1px solid #333;
    position: relative;
    z-index: 5;
    opacity: 0.7;
}

/* Loading */
.retro-loading {
    text-align: center;
    padding: 1.5rem;
    position: relative;
    z-index: 5;
}

.retro-loading-text {
    color: #33ff33;
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(51, 255, 51, 0.8);
}

.retro-loading-text::before {
    content: ">>> ";
}

.retro-loading-text::after {
    content: "_";
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Animation de curseur */
@keyframes cursor-blink {
    0%, 50% { border-right-color: #33ff33; }
    51%, 100% { border-right-color: transparent; }
}

/* Responsive */
@media (max-width: 768px) {
    .retro-switcher-container {
        margin: 1rem;
        border-width: 2px;
    }
    
    .retro-switcher-title {
        font-size: 0.7rem;
        padding: 1rem 0.5rem 0.5rem;
    }
    
    .retro-switcher-options {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }
    
    .retro-option {
        padding: 0.6rem 0.8rem;
        margin: 0.2rem;
    }
    
    .retro-emoji {
        font-size: 1.4rem;
    }
    
    .retro-name {
        font-size: 1.2rem;
    }
    
    .retro-desc {
        display: none;
    }
    
    .retro-option-default .retro-name {
        font-size: 1rem;
    }
    
    .retro-switcher-default::before {
        font-size: 0.5rem;
    }
}

@media (max-width: 480px) {
    .retro-switcher-title {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }
    
    .retro-switcher-title::before,
    .retro-switcher-title::after {
        content: "* ";
    }
    
    .retro-switcher-title::after {
        content: " *";
    }
}
