/**
 * Stylesheet PiloteGest Quizz & Live WordCloud
 * Style immersif, responsive et moderne
 */

:root {
    --quiz-red: #e21b3c;
    --quiz-blue: #1368ce;
    --quiz-yellow: #d89e00;
    --quiz-green: #26890c;
    --quiz-purple: #46178f;
    --quiz-dark-purple: #33106a;
    --quiz-dark-blue: #0b1e36;
    
    --pg-primary: #004AAD;
    --pg-accent: #00C853;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 35px -5px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 25px rgba(255, 255, 255, 0.3);
}

* {
    box-sizing: border-box;
}

body.quizz-body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at 10% 10%, #2e0854 0%, #150530 50%, #0a0218 100%);
    color: #ffffff;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Dashboard / Management pages styling */
.quizz-admin-layout {
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
}

.quizz-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.quizz-brand-badge {
    background: linear-gradient(135deg, #46178f 0%, #864cbf 100%);
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
    padding: 6px 14px;
    border-radius: 12px;
    letter-spacing: -0.5px;
}

.stat-card-quiz {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card-quiz:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Activity Card */
.activity-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.activity-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.activity-card-header {
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #46178f 0%, #1368ce 100%);
    color: white;
}

.activity-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.btn-play-pulse {
    background: linear-gradient(135deg, #26890c 0%, #2ecc71 100%);
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(38, 137, 12, 0.4);
    transition: all 0.2s ease;
}

.btn-play-pulse:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(38, 137, 12, 0.6);
    color: white;
}

/* ================================================= */
/* HOST SCREEN (GRAND ECRAN DE PROJECTION)            */
/* ================================================= */
.host-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.5rem;
    overflow: hidden;
}

.host-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 0.8rem 1.5rem;
    margin-bottom: 1.5rem;
}

.host-pin-box {
    background: #ffffff;
    color: #111827;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    box-shadow: var(--shadow-glow);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.host-pin-box:hover {
    transform: scale(1.03);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
}

.host-lobby-main {
    flex: 1;
    display: flex;
    gap: 2rem;
    align-items: stretch;
    min-height: 0;
}

.lobby-qr-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.lobby-qr-holder {
    background: #ffffff;
    padding: 16px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 252px;
    min-height: 252px;
}

.lobby-qr-holder canvas, .lobby-qr-holder img {
    border-radius: 12px;
}

.lobby-players-card {
    flex: 1.5;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.players-grid {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
    padding: 10px;
}

.player-chip {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

@keyframes popIn {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Question Active Host Screen */
.question-header-card {
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    box-shadow: var(--shadow-md);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-middle-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem 1.5rem;
    gap: 2rem;
}

.timer-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #46178f;
    border: 8px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 900;
    color: #ffffff;
    box-shadow: var(--shadow-lg);
    animation: pulseTimer 1s infinite alternate;
}

.timer-circle.urgent {
    background: var(--quiz-red);
    border-color: #ffb4c0;
    animation: shakeUrgent 0.2s infinite;
}

@keyframes pulseTimer {
    0% { transform: scale(1); }
    100% { transform: scale(1.04); }
}

@keyframes shakeUrgent {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    25% { transform: translate(-2px, -1px) rotate(-1deg); }
    50% { transform: translate(-1px, 2px) rotate(1deg); }
    75% { transform: translate(2px, 1px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.answers-counter-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Answer Blocks */
.answers-grid-host {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 16px;
    height: 42vh;
}

.answer-card-host {
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
    gap: 1.2rem;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, opacity 0.3s ease;
}

.answer-card-host.red { background-color: var(--quiz-red); }
.answer-card-host.blue { background-color: var(--quiz-blue); }
.answer-card-host.yellow { background-color: var(--quiz-yellow); }
.answer-card-host.green { background-color: var(--quiz-green); }

.answer-shape-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    flex-shrink: 0;
}

.answer-card-host.dimmed {
    opacity: 0.25;
    transform: scale(0.98);
}

.answer-card-host.winner {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.9), 0 0 15px currentColor;
    transform: scale(1.02);
}

.correct-badge-pill {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #111827;
    font-size: 1.2rem;
    font-weight: 900;
    padding: 8px 18px;
    border-radius: 30px;
    box-shadow: var(--shadow-md);
}

/* ================================================= */
/* LIVE WORD CLOUD STAGE & CLOUD SHAPE               */
/* ================================================= */
.wordcloud-cloud-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    max-width: 960px;
    height: 480px;
    max-height: calc(100vh - 240px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cloud-backdrop-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.25));
}

.wordcloud-words-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 82%;
    height: 76%;
    z-index: 2;
    overflow: hidden;
}

.wordcloud-item-cloud {
    position: absolute;
    font-family: 'Outfit', 'Segoe UI', -apple-system, sans-serif;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.015em;
    cursor: default;
    user-select: none;
    white-space: nowrap;
    transform-origin: center center;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: popCloudWord 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wordcloud-item-cloud:hover {
    transform: scale(1.15);
    z-index: 20;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.15));
}

@keyframes popCloudWord {
    0% { transform: scale(0.1); opacity: 0; }
    70% { transform: scale(1.12); opacity: 0.95; }
    100% { transform: scale(1); opacity: 1; }
}

.wordcloud-empty-cloud {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    text-align: center;
    width: 90%;
    max-width: 500px;
    pointer-events: none;
}

.wordcloud-empty-cloud h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

/* ================================================= */
/* LEADERBOARD & 3D PODIUM                           */
/* ================================================= */
.leaderboard-list {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Podium 3D Stage */
.podium-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    height: 50vh;
    margin-top: 2rem;
}

.podium-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 220px;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.podium-box {
    width: 100%;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: 900;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
}

.podium-column.first .podium-box {
    height: 280px;
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    border-top: 4px solid #fef3c7;
}

.podium-column.second .podium-box {
    height: 200px;
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    border-top: 4px solid #f1f5f9;
}

.podium-column.third .podium-box {
    height: 140px;
    background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
    border-top: 4px solid #fed7aa;
}

.podium-player-info {
    margin-bottom: 12px;
    text-align: center;
}

.podium-avatar {
    font-size: 3.5rem;
    margin-bottom: 4px;
    display: block;
    animation: bounceAvatar 1.5s infinite alternate;
}

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

/* ================================================= */
/* PLAYER MOBILE SCREEN (PLAY.PHP)                   */
/* ================================================= */
.player-mobile-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    justify-content: space-between;
}

.player-mobile-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
}

.mobile-answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 14px;
    flex: 1;
    margin: 1.5rem 0;
}

.mobile-answer-btn {
    border: none;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3.5rem;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease, filter 0.1s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-answer-btn:active {
    transform: scale(0.94);
    filter: brightness(0.85);
}

.mobile-answer-btn.red { background-color: var(--quiz-red); }
.mobile-answer-btn.blue { background-color: var(--quiz-blue); }
.mobile-answer-btn.yellow { background-color: var(--quiz-yellow); }
.mobile-answer-btn.green { background-color: var(--quiz-green); }

.feedback-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-xl);
    animation: popIn 0.3s ease-out;
}

.feedback-screen.correct {
    background: radial-gradient(circle, #26890c 0%, #165606 100%);
}

.feedback-screen.wrong {
    background: radial-gradient(circle, #e21b3c 0%, #8b081e 100%);
}

.feedback-screen.waiting {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
}
