/* =================================
ORIENTATION & SCREEN MANAGEMENT
================================= */

/* Smartphone en mode portrait (384x822 en plein écran) */
@media screen and (max-width: 750px) and (orientation: portrait) {
    body::after {
        content: "Smartphone/Tablette - portrait";
    }
    .activity-item {
        flex-direction: row;
        align-items: self-start;
        gap: 10px;
    }
    
    .activity-item > div:first-child {
        display: flex;
        gap: 10px;
        align-items: center;
    }
    
    .activity-controls {
        flex-direction: column;
    }
    
    .config-activity-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 15px;
    }
    
    .config-activity-content {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .config-name-input {
        flex: 1;
        min-width: 0;
    }
    
    .config-duration-input {
        width: 70px;
    }
    
    .config-activity-controls {
        justify-content: center;
        gap: 10px;
        margin-top: 5px;
    }

    .btn {
        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;
    }

    .centered-controls .btn {
        margin: 10px;
    }

    /* =================================
    FOCALISATION GLISSANTE MOBILE
    ================================= */
    
    .race-track-container {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        /* Masquer la scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
        position: relative;
    }
    
    .race-track-container::-webkit-scrollbar {
        display: none;
    }
    
    .race-track {
        /* Permettre à la piste d'être plus large que l'écran */
        width: max-content;
        /* min-width: 100%; */
    }
    
    .activity-chain {
        width: 100%;
        display: flex;
    }

    .activity-segment {
        flex-shrink: 0; /* Empêche la réduction des segments */
    }
    
    /* Indicateur visuel de scroll */
    .race-track-container::before {
        content: "";
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        background: rgba(0,0,0,0.3);
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        z-index: 10;
    }
    
    .race-track-container.scrollable::before {
        opacity: 1;
    }
}

/* Smartphone en mode paysage (822x384 en plein écran) */
/* Tablette en mode paysage (960x552 en plein écran) */
@media screen and (max-height: 600px) and (orientation: landscape) {
    body::after {
        content: "Smartphone/Tablette-paysage";
    }
    .screen.active {
        padding-left: 15px;
        padding-right: 15px;
    }
    .container {
        padding: 0px;
    }
    .header {
        margin: 5px;
    }
    .header h1 {
        font-size: 2em;
        margin-bottom: 0px;
    }
    .header h2 {
        font-size: 1.5em;
        margin-bottom: 0px;
    }
    .activity-list {
        margin-top: 5px;
        margin-bottom: 10px;
        padding: 10px;
    }
    .btn {
        height: 48px;
    }
    .timer-info {
        margin-bottom: 0px;
        font-size: 1.0rem;
    }
    .race-track-container {
        padding: 10px;
        margin-left: 20px;
        margin-right: 20px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        /* Masquer la scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
        position: relative;
    }
    
    .race-track-container::-webkit-scrollbar {
        display: none;
    }
    
    .race-track {
        height: 40px;
        /* Permettre à la piste d'être plus large que l'écran */
        width: max-content;
        /* min-width: 200vw; */
    }
    
    .activity-chain {
        width: 100%;
        display: flex;
    }

    .activity-segment {
        flex-shrink: 0; /* Empêche la réduction des segments */
    }
    
    /* Indicateur visuel de scroll pour paysage */
    .race-track-container::before {
        content: "";
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 15px;
        height: 15px;
        background: rgba(0,0,0,0.3);
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        z-index: 10;
    }
    
    .race-track-container.scrollable::before {
        opacity: 1;
    }
    
    .circular-minuteur {
        transform: scale(0.5);
        transform-origin: center center;
    }
    .timer-controls {
        height: 100px;
    }

    .config-activity-item {
        padding: 10px 15px;
    }
    
    .config-activity-content {
        gap: 10px;
    }
    
    .config-name-input {
        font-size: 0.9em;
        padding: 6px 10px;
    }
    
    .config-duration-input {
        font-size: 0.9em;
        padding: 6px 10px;
        width: 70px;
    }
}