* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    flex-shrink: 0;
    background: #007cba;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 1rem;
}

.header-title {
    flex: 1;
    text-align: center;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.back-arrow {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    font-size: 1.4rem;
    color: white;
    cursor: pointer;
}

.back-arrow svg {
    width: 1em;
    height: 1em;
    display: block;
}

header img {
    width: 100%;
    height: auto;
}

.subtitle {
    font-size: 1em;
    opacity: 0.9;
}

.toolbar {
    background: white;
    padding: 10px 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.location-description {
    padding: 12px 16px;
    background: #005a87;
    font-size: 0.95em;
    color: white;
    display: none;
    text-align: center;
    line-height: 1.4;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.filter-label {
    font-weight: 600;
    color: #007cba;
    white-space: nowrap;
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    flex-grow: 0;
    filter: grayscale(1);
    opacity: 0.5;
    box-sizing: border-box;
    line-height: 1;
}

.filter-btn.active {
    background: transparent;
    border: none;
    filter: grayscale(0);
    opacity: 1;
}

.date-selector label {
    font-weight: 600;
    color: #007cba;
}

.date-selector input {
    padding: 10px 15px;
    border: 2px solid #007cba;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
}

.clear-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 0.9em;
}

.reset-btn {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    filter: grayscale(1);
    opacity: 0.5;
    box-sizing: border-box;
    line-height: 1;
}

.reset-btn:hover {
    filter: grayscale(0);
    opacity: 1;
}

.share-btn {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    filter: grayscale(1);
    opacity: 0.5;
    box-sizing: border-box;
    line-height: 1;
}

.share-btn:hover {
    filter: grayscale(0);
    opacity: 1;
}



.movies-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sticky-header {
    position: sticky;
    top: 0;
}

.day-separator {
    background: #007cba;
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.day-separator h2 {
    color: white;
    font-size: 1.2em;
    margin: 0;
    text-transform: capitalize;
    font-weight: 600;
}

.movie-card {
    background: white;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    height: 240px;
    border: 3px solid transparent;
}

.movie-card .movie-info {
    overflow: hidden;
}



.movie-card.shrinking {
    display: none;
}

.movie-card.appearing {
    display: block;
}

.movie-card.movie-liked {
    border-color: #28a745;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.movie-card.movie-not-for-me {
    border-color: #dc3545;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.movie-poster-wrapper {
    width: 200px;
    min-width: 200px;
    height: 240px;
    background: #007cba;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.movie-poster-wrapper.has-image {
    background: transparent;
}

.movie-poster-wrapper::after {
    content: '🎬';
    font-size: 100px;
    color: white;
    opacity: 0.2;
    pointer-events: none;
    line-height: 1;
}

.movie-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    font-size: 0;
    color: transparent;
    text-indent: -9999px;
}

/* Masquer l'icône quand l'image charge correctement */
.movie-poster-wrapper:has(img[src]:not([src=""]):not([src*="TODO"]))::after {
    display: none;
}

.movie-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    height: 240px;
    min-height: 0;
}

.movie-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.movie-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    margin: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.movie-badge {
    font-size: 0.7em;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-liked {
    background-color: #4caf50;
    color: white;
}

.badge-not-for-me {
    background-color: #f44336;
    color: white;
}

.movie-details {
    color: #666;
    font-size: 0.85em;
    margin: 0;
    flex: 0 0 auto;
}

.movie-details span {
    display: inline-block;
    margin-right: 15px;
}

.movie-details .duration::before {
    content: "⏱️ ";
}

.movie-header-right {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

.synopsis {
    margin: 6px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007cba;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    white-space: pre-wrap;
}

.synopsis p {
    color: #555;
    line-height: 1.4;
    font-size: 0.8em;
    margin: 0;
 }

.synopsis::-webkit-scrollbar {
    width: 4px;
}

.synopsis::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.synopsis::-webkit-scrollbar-thumb {
    background: #007cba;
    border-radius: 2px;
}

.synopsis::-webkit-scrollbar-thumb {
    background: #007cba;
}

.no-sessions-message {
    background: #f5f5f5;
    color: #666;
    padding: 40px 20px;
    text-align: center;
    font-size: 1.2em;
}

.showtimes {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.showtimes h3 {
    display: none;
}

.movie-actions {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
    margin-left: auto;
    align-items: center;
}

.action-btn {
    background: transparent;
    border: none;
    font-size: 1.4em;
    cursor: pointer;
    padding: 4px 8px;
    filter: grayscale(1);
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-like.active {
    filter: grayscale(0);
    opacity: 1;
    color: #e53935;
}

.btn-not-for-me.active {
    filter: grayscale(0);
    opacity: 1;
    color: #888;
}

.movie-footer {
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
}

.movie-link {
    flex: 1;
}

.external-link,
.external-link a {
    display: inline-block;
    color: #007cba;
    font-weight: 600;
    font-size: 0.95em;
}



.undo-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.undo-container.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.undo-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}



.showtimes h3 {
    font-size: 0.85em;
    color: #007cba;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.showtime-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cinema-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cinema-name {
    font-size: 0.9em;
    font-weight: bold;
    color: #666;
    margin-bottom: 2px;
}

.cinema-sessions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.showtime-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 50px;
    text-align: center;
}

@media (max-width: 768px) {
    .toolbar {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        height: 60px;
        border-bottom: 1px solid #eee;
    }
    
    .filter-label {
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .reset-btn {
        font-size: 24px;
        padding: 0;
        width: 50px;
        height: 50px;
    }

    .filter-btn {
        flex-grow: 0;
        width: 50px;
        font-size: 24px;
    }

    .movie-card {
        flex-direction: column;
        height: auto;
    }

    .movie-info {
        height: auto;
    }
    
.movie-poster-wrapper {
        width: 100%;
        height: auto;
        order: 1;
        border-radius: 12px 12px 0 0;
    }

    .movie-poster {
        width: 100%;
        height: auto;
    }

    .synopsis {
        max-height: unset;
    }

    .showtime-list {
        gap: 6px;
    }

    .cinema-group {
        gap: 3px;
    }

    .cinema-name {
        font-size: 0.85em;
    }

    .action-btn {
        width: 50px;
        height: 50px;
        font-size: 1.8em;
    }

    .movie-link {
        flex-wrap: wrap;
    }

    /* Bouton remonter en haut de page */
    .scroll-to-top {
        position: fixed;
        bottom: 20px;
        right: 15px;
        background: #007cba;
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
    
    .scroll-to-top svg {
        width: 24px;
        height: 24px;
        display: block;
    }

    .scroll-to-top.show {
        opacity: 1;
        pointer-events: auto;
    }

    .scroll-to-top:hover {
        transform: scale(1.1);
        background: #005a87;
    }

    .card-placeholder {
        min-height: 250px;
        height: auto;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.2em;
    }
    .back-arrow {
        width: 24px;
    }
}

/* Styles pour les messages de chargement et d'erreur */
.loading-message, .error-message {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 500px;
}

.loading-message {
    color: #666;
    font-size: 1.1em;
}

.error-message {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.error-message h3 {
    color: #721c24;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.error-message p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.retry-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 15px;
}

/* Event placeholder - film strip style */
.card-placeholder {
    background-color: #111;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.card-placeholder::before, .card-placeholder::after {
    content: "";
    position: absolute;
    top: 0;
    width: 25px;
    height: 200%;
    background-image: radial-gradient(circle, #333 35%, transparent 40%);
    background-size: 100% 40px;
    animation: film-scroll 8s linear infinite;
}

.card-placeholder::before { left: 10px; }
.card-placeholder::after { right: 10px; }

@keyframes film-scroll {
    from { transform: translateY(0); }
    to { transform: translateY(-40px); }
}

.placeholder-title {
    color: #eee;
    font-family: 'Arial Black', sans-serif;
    font-size: 1.8rem;
    text-align: center;
    text-transform: uppercase;
    z-index: 2;
    padding: 0 40px;
    line-height: 1.1;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.placeholder-badge {
    background: #ffcc00;
    color: #000;
    padding: 4px 12px;
    font-weight: bold;
    font-size: 0.8rem;
    margin-top: 15px;
    z-index: 2;
}

.attribution {
    text-align: center;
    font-size: 0.8em;
    color: #888;
    padding: 15px;
}

.attribution a {
    color: #007cba;
    text-decoration: none;
}

