/* =================================
    STYLES DE BASE
================================= */
    * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    src: url('static/fonts/Jua-Regular.ttf') format('truetype');
    font-family: 'Jua', sans-serif;
    font-weight: 400;
    font-style: normal;
}

body {
    font-family: 'Jua', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

body::after {
    content: "Thème par défaut";
    display: none;
}

.container {
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex: 1;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

.header {
    margin-top: 30px;
    margin-bottom: 30px;
}

.header h1 {
    text-align: center;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* =================================
    BOUTTONS
================================= */
.btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 1.3em;
    border-radius: 7px;
    cursor: pointer;
    margin: 5px;
    box-shadow: 0 2px 7px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(45deg, #2196F3, #1976D2);
}

.btn-danger {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

.fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.fullscreen-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.period-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 1.2em;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.period-btn.active {
    background: rgba(76, 175, 80, 0.8);
    transform: scale(1.05);
}

.reorder-btn {
    background: rgba(108, 117, 125, 0.8);
    border: none;
    color: white;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 2px;
    transition: all 0.3s ease;
}

.reorder-btn:hover:not(:disabled) {
    background: rgba(108, 117, 125, 1);
    transform: translateY(-1px);
}

.reorder-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.toggle-activities-btn {
    text-align: center;
    cursor: pointer;
    color: white;
    padding: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    margin-bottom: 10px;
    user-select: none;
    transition: background 0.3s ease;
    font-weight: bold;
}

.toggle-activities-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* =================================
    ACTIVITES
================================= */
.activity-list {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    margin: 20px ;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.activity-item {
    background: rgba(255,255,255,0.15);
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 12px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.activity-item > span:first-child {
    width: 40px;
    text-align: center;
    font-size: 1.2em;
    flex-shrink: 0;
}

.activity-item > span:nth-child(2) {
    flex: 1;
    margin: 0 15px;
    text-align: left;
}

.activity-item > span:last-child {
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.activity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.collapsible {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease;
}

.collapsible.open {
    max-height: 1000px;
}

/* ============================================
    INFORMATIONS TEMPORELLES (page d'accueil)
============================================ */
.time-info {
    background: rgba(0,0,0,0.5);
    border-radius: 15px;
    padding: 15px 20px;
    margin: 20px auto;
    backdrop-filter: blur(10px);
    max-width: 400px;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.total-duration, .estimated-end {
    text-align: center;
}

.total-duration span, .estimated-end span {
    font-weight: bold;
    color: #FFD700;
}

.timer-info {
    margin-top: 5px;
    margin-bottom: 15px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.timer-info .start-time,
.timer-info .end-time {
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    min-width: 140px;
    text-align: center;
}

/* =================================
    CIRCULAR TIMER
================================= */
.circular-minuteur {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 20px 0;
}

.circular-minuteur svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-minuteur circle {
    fill: none;
    stroke-width: 8;
}

.circular-minuteur .background {
    stroke: rgba(255,255,255,0.2);
}

.circular-minuteur .progress {
    stroke: #4CAF50;
    stroke-dasharray: 251.33;
    stroke-dashoffset: 251.33;
    /* transition: stroke-dashoffset 1s linear; */
}

.minuteur-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    width: 180px;
    text-align: center;
}

.timer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
    gap: 30px;
    margin: 0 auto;
}

/* =================================
    RACE TRACK COMPONENTS
================================= */
.race-track-container {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    width: 100%;
    padding-top: 30px;
    padding-bottom: 30px;
}

.race-track {
    position: relative;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    margin: 40px 0;
    overflow: visible;
}

.activity-chain {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.activity-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255,255,255,0.3);
    border-right: 1px solid rgba(255,255,255,0.5);
    transition: all 0.3s ease;
}

.activity-segment:last-child {
    border-right: none;
}

.activity-segment.completed {
    background: rgba(76,175,80,0.7);
}

.activity-segment.current {
    background: rgba(255,193,7,0.7);
    box-shadow: 0 0 10px rgba(255,193,7,0.5);
}

.activity-segment.current-child {
    border-top: 4px solid #FFD700;
    box-shadow: 0 -2px 10px rgba(255, 215, 0, 0.5);
}

.activity-segment.current-avatar {
    border-bottom: 4px solid #FF6B6B;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
}

.start-line, .finish-line {
    position: absolute;
    top: -0px;
    bottom: 0px;
    width: 3px;
    background: repeating-linear-gradient(
        to bottom,
        white 0px,
        white 6px,
        transparent 6px,
        transparent 12px
    );
    z-index: 10;
}

.start-line {
    left: 0;
}

.finish-line {
    right: 0;
}

.participant {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 20;
    transform: translateX(-50%);
}

.participant.child {
    top: -60px;
}

.participant.avatar {
    bottom: -60px;
}

.participant-group {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
    transition: transform 0.5s linear;
}

.participant-group.child {
    top: 10px;
}

.participant-group.avatar {
    bottom: 10px;
}

.position-line {
    position: absolute;
    width: 2px;
    background: rgba(255,255,255,0.8);
    transform: translateX(-50%);
    left: 50%;
}

.position-line.child {
    top: -20px;
    height: 10px;
}

.position-line.avatar {
    bottom: -20px;
    height: 10px;
}

/* =================================
    MODAL COMPONENTS
================================= */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirmation-modal.show {
    opacity: 1;
}

.confirmation-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    margin: 20px;
    color: white;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

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

.confirmation-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: bold;
}

.confirmation-message {
    font-size: 1.1em;
    margin-bottom: 25px;
    line-height: 1.4;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirmation-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 12px 25px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.confirmation-btn.cancel:hover {
    background: rgba(108, 117, 125, 0.8);
}

.confirmation-btn.confirm {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

.confirmation-btn.confirm:hover {
    background: linear-gradient(45deg, #d32f2f, #b71c1c);
    transform: translateY(-2px);
}

/* =================================
    TOAST NOTIFICATIONS
================================= */
.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 12px;
    color: #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #4CAF50;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1em;
    min-width: 280px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #4CAF50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.warning {
    border-left-color: #ff9800;
}

.toast-icon {
    font-size: 1.2em;
}

/* =================================
    BILAN STYLES
================================= */
.activity-report {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    max-width: 600px;
    width: 100%;
}

.activity-report h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #FFD700;
}

.report-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.05);
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 8px;
}

.report-activity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-time.advance {
    color: #4CAF50;
}

.report-time.delay {
    color: #f44336;
}

.report-time.ontime {
    color: #FFD700;
}

/* TODO : Les éléments ci-dessous sont à organiser */

.centered-controls {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 20px;
}

.centered-controls.small-gap {
    margin-top: 10px;
    margin-bottom: 10px;
}

.centered-controls .btn {
    margin: 0 6px;
}

/* container pour pill toggle période */
.controls-pill {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.period-toggle {
    display: inline-flex;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 4px;
}

/* aligner un bloc vertical centré (utilisé sur timerScreen) */
.centered-vertical {
    text-align: center;
    margin-bottom: 10px;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* wrapper pour l'écran de fin qui remplace styles inline */
.end-screen {
    display: none; /* l'app JS gère l'affichage (avant: display:none) */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    backdrop-filter: blur(50px);
    overflow-y: auto;
}

.end-screen.show {
    display: block;
}

.end-screen-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

.end-message {
    text-align: center;
    font-size: 2em;
    margin-bottom: 0;
}

/* toast container (remplace style inline) */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
}

/* debug indicator (remplace style inline) */
.css-debug-indicator {
    position: fixed;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 9999;
}

/* petite variante d'alignement pour boutons de configuration */
.config-actions {
    margin-top: 10px;
    margin-bottom: 20px;
    text-align: center;
}

/* sécurité : si une logique JS montrait encore des styles inline,
   on peut forcer l'affichage par les classes ci-dessous */
.collapsible.open { max-height: 1000px; }

.config-activity-item {
    background: rgba(255,255,255,0.15);
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.config-activity-content {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
}

.config-emoji {
    font-size: 1.4em;
    width: 60px;
    text-align: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
}

.config-name-input {
    flex: 1;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    min-width: 0; /* Important pour éviter le débordement */
}

.config-name-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.config-duration-input {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.config-duration-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.config-activity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.config-duration-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.config-duration-input.minutes,
.config-duration-input.seconds {
    width: 70px;
    text-align: center;
}

.duration-separator {
    color: white;
    font-weight: bold;
}
