/* LUCKY YOU! - Styles principaux
   Version: 2.0.0
   Framework: Ionic-inspired
*/

/* ======== Variables ======== */
:root {
    /* Couleurs principales */
    --primary-bg: #0a1032;
    --secondary-bg: #0d143c;
    --card-bg: #182a70;
    
    /* Couleurs de texte */
    --text-primary: #ffffff;
    --text-secondary: #b0b7d1;
    
    /* Couleurs d'accent */
    --accent-color: #00c8ff;
    --accent-secondary: #006eff;
    --accent-tertiary: #ffb800;
    
    /* Couleurs sémantiques */
    --success-green: #4dffb4;
    --failure-red: #ff4d6b;
    --warning: #ffaa36;
    
    /* Ombres et effets */
    --card-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    --button-shadow: 0 4px 15px rgba(0, 200, 255, 0.3);
    --text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ======== Styles de base ======== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(13, 20, 60, 0) 0%, var(--primary-bg) 100%);
    z-index: -1;
}

h2, h3, h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-tertiary);
}

ul, ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td, th {
    padding: 10px;
    text-align: left;
}

/* ======== Container principal ======== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* ======== Barre latérale de navigation ======== */
.sidebar {
    width: 80px;
    background: rgba(13, 20, 60, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    backdrop-filter: blur(10px);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.sidebar-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
}

.sidebar-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateX(5px);
}

.sidebar-icon.active {
    background: var(--accent-color);
    color: var(--primary-bg);
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
}

/* ======== Contenu principal ======== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ======== En-tête de l'application ======== */
.app-header {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    background: rgba(13, 20, 60, 0.7);
    backdrop-filter: blur(10px);
    z-index: 5;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--primary-bg);
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.points-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-weight: 600;
}

.points-icon {
    color: var(--accent-tertiary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-bg);
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}

/* ======== Écrans ======== */
.screen {
    display: none;
    flex-direction: column;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

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

.screen.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ======== Écran d'accueil ======== */
.hero-banner {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--card-bg) 100%);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.hero-content {
    flex: 1;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 25px;
    max-width: 500px;
}

.hero-button {
    background: var(--accent-color);
    border: none;
    color: var(--primary-bg);
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--button-shadow);
}

.hero-button:hover {
    transform: translateY(-5px);
    background: var(--accent-secondary);
    box-shadow: 0 8px 20px rgba(0, 110, 255, 0.4);
}

.hero-graphics {
    width: 40%;
    position: relative;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.game-card {
    background: var(--secondary-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    height: 200px;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.game-card-image {
    height: 60%;
    position: relative;
    background-size: cover;
    background-position: center;
}

.game-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 16, 50, 0.4) 0%, var(--secondary-bg) 100%);
}

.game-card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.game-card-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 10px;
}

.game-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-card-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.game-card-button {
    background: var(--accent-color);
    border: none;
    color: var(--primary-bg);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-card-button:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

/* ======== Écran de jeu ======== */
.game-play-area {
    background: rgba(24, 42, 112, 0.8);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.game-status-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-score, .game-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.score-value {
    color: var(--accent-color);
    font-size: 20px;
}

.game-message {
    text-align: center;
    margin: 20px 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    min-height: 50px;
    width: 100%;
}

.coins-area {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    perspective: 1000px;
}

.coin {
    width: 120px;
    height: 120px;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.coin.flipped {
    transform: rotateY(180deg);
}

.coin-front, .coin-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.coin-front {
    background: linear-gradient(135deg, var(--accent-tertiary), #ffce45);
    color: var(--primary-bg);
}

.coin-back {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    color: var(--primary-bg);
    transform: rotateY(180deg);
}

.coin-back.win {
    background: linear-gradient(135deg, var(--success-green), #00f084);
    color: var(--primary-bg);
}

.coin-back.lose {
    background: linear-gradient(135deg, var(--failure-red), #ff0a33);
    color: var(--primary-bg);
}

.coin-symbol {
    font-size: 40px;
}

.game-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    width: 100%;
}

#choice-actions {
    text-align: center;
    margin-bottom: 15px;
}

#continue-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* ======== Panneau des statistiques ======== */
.stats-panel {
    background: rgba(13, 20, 60, 0.7);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    max-width: 800px;
    margin: 0 auto 20px;
    width: 100%;
}

.stats-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.stats-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stats-label {
    color: var(--text-secondary);
}

.stats-value {
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

/* ======== Écran de fin de partie ======== */
.result-container {
    background: rgba(24, 42, 112, 0.8);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.result-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.result-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.result-title {
    font-size: 28px;
    font-weight: 700;
}

.final-score-container {
    margin-bottom: 30px;
}

.final-score-label {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.final-score {
    font-size: 60px;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(0, 200, 255, 0.5);
    margin-bottom: 5px;
}

.result-message {
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.result-stats {
    background: rgba(13, 20, 60, 0.5);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.save-score-container {
    background: rgba(13, 20, 60, 0.5);
    border-radius: 15px;
    padding: 20px;
}

.save-score-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.score-input-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.score-input {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-bg);
    font-size: 16px;
}

.save-success {
    color: var(--success-green);
    font-weight: 600;
    margin-top: 15px;
}

/* ======== Footer ======== */
.app-footer {
    padding: 20px 30px;
    background: rgba(13, 20, 60, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.footer-link {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--accent-color);
}

.footer-copyright {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ======== Éléments flottants ======== */
.floating-cards {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-card {
    position: absolute;
    width: 120px;
    height: 180px;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.05), rgba(0, 110, 255, 0.05));
    border-radius: 15px;
    border: 1px solid rgba(0, 200, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 200, 255, 0.1);
    animation: float-around 30s linear infinite;
}

.floating-chip {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.05), rgba(255, 207, 67, 0.05));
    border: 1px solid rgba(255, 184, 0, 0.1);
    box-shadow: 0 0 30px rgba(255, 184, 0, 0.1);
    animation: float-around 25s linear infinite;
}

@keyframes float-around {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(200px, 100px) rotate(90deg);
    }
    50% {
        transform: translate(100px, 250px) rotate(180deg);
    }
    75% {
        transform: translate(-150px, 100px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* ======== Bannière de vérification d'âge ======== */
.age-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: rgba(13, 20, 60, 0.9);
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.age-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.age-banner-icon {
    font-size: 24px;
    color: var(--warning);
}

.age-banner-text h3 {
    margin-bottom: 5px;
}

.age-banner-text p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ======== Système de modales ======== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.modal-open {
    opacity: 1;
    visibility: visible;
}

.modal-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 16, 50, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--secondary-bg);
    border-radius: 20px;
    max-width: 90%;
    width: 500px;
    max-height: 90vh;
    position: relative;
    z-index: 1001;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal.modal-open .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

/* Styles spécifiques aux modales */
.date-selects {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.date-select {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-bg);
    font-size: 16px;
}

.terms-checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

/* ======== Boutons d'action ======== */
.action-button {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--primary-bg);
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.3);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 110, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.btn-danger {
    background: var(--failure-red);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(255, 77, 107, 0.3);
}

.btn-danger:hover {
    background: #ff0a33;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(255, 10, 51, 0.4);
}

.btn-warning {
    background: var(--warning);
    color: var(--primary-bg);
    box-shadow: 0 0 15px rgba(255, 170, 54, 0.3);
}

.btn-warning:hover {
    background: #ff9800;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.4);
}

/* ======== Disclaimer Box ======== */
.disclaimer-box {
    background: rgba(255, 77, 107, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    border-left: 3px solid var(--failure-red);
}

.disclaimer-box h3 {
    color: var(--failure-red);
    margin-bottom: 10px;
    font-size: 16px;
}

.disclaimer-box p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.disclaimer-box p:last-child {
    margin-bottom: 0;
}

/* ======== Animations ======== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

@keyframes particleAnimation {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--translateX), var(--translateY)) scale(0);
        opacity: 0;
    }
}

.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
}

/* ======== Adaptations mobiles ======== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .app-header {
        padding: 0 15px;
    }

    .logo {
        font-size: 20px;
    }

    .logo-icon {
        width: 30px;
        height: 30px;
    }

    .hero-banner {
        flex-direction: column;
    }

    .hero-content {
        width: 100%;
        margin-bottom: 20px;
    }

    .hero-graphics {
        width: 100%;
        height: 150px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .game-cards {
        grid-template-columns: 1fr;
    }

    .coins-area {
        gap: 20px;
    }

    .coin {
        width: 100px;
        height: 100px;
    }

    .result-actions {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .score-input-container {
        flex-direction: column;
    }

    .date-selects {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
    }
}

/* ======== Adaptations tablettes ======== */
@media (min-width: 769px) and (max-width: 1024px) {
    .game-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ======== Adaptations d'accessibilité ======== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
