/**
 * JTR Remerciements — Styles frontend
 * Version 5.0.0 - Refonte modulaire
 */

/* ===== Wrapper ===== */
.jtr-remerciements-wrapper {
    max-width: 98%;
    margin: 0 auto;
    padding: 20px 1%;
}

/* ===== Barre de filtres ===== */
.jtr-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.jtr-filter-select {
    padding: 12px 40px 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.jtr-filter-select:hover,
.jtr-filter-select:focus {
    border-color: #99cc33;
    outline: none;
    box-shadow: 0 0 0 3px rgba(153, 204, 51, 0.15);
}

.jtr-counter {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: #495057;
    border: 2px solid #dee2e6;
    white-space: nowrap;
}

/* ===== Grille ===== */
.jtr-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

/* ===== Carte ===== */
.jtr-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.jtr-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.jtr-item img,
.jtr-item video {
    width: 100%;
    height: 190px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

/* ===== Vidéo wrapper ===== */
.jtr-video-wrapper {
    position: relative;
    cursor: pointer;
}

.jtr-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: none;
}

.jtr-video-icon::after {
    content: '▶';
    color: white;
    font-size: 24px;
    margin-left: 4px;
}

.jtr-video-wrapper:hover .jtr-video-icon {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.jtr-video-wrapper.playing .jtr-video-icon {
    display: none;
}

.jtr-video-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}

.jtr-video-wrapper:hover .jtr-video-progress,
.jtr-video-wrapper.playing .jtr-video-progress {
    opacity: 1;
}

.jtr-video-progress-bar {
    height: 100%;
    background: #99cc33;
    width: 0%;
    transition: width 0.1s linear;
}

.jtr-video-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.jtr-video-wrapper:hover .jtr-video-controls,
.jtr-video-wrapper.playing .jtr-video-controls {
    opacity: 1;
}

.jtr-video-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.jtr-video-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* ===== Contenu de la carte ===== */
.jtr-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.jtr-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

.jtr-date,
.jtr-country,
.jtr-genre {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
}

.jtr-flag {
    width: 1em !important;
    height: auto !important;
    display: inline-block !important;
    margin-right: 6px !important;
    vertical-align: middle;
}

.jtr-title {
    font-size: 16px;
    margin: 8px 0;
    font-weight: 600;
}

.jtr-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* ===== Erreur ===== */
.jtr-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 6px;
    margin: 12px 0;
    text-align: center;
    border: 1px solid #ffcdd2;
}

/* ===== Barre de progression ===== */
.jtr-progress {
    max-width: 600px;
    width: 100%;
    margin: 24px auto 0;
}

.jtr-progress-bar {
    background: #e3e3e3;
    border-radius: 6px;
    height: 18px;
    overflow: hidden;
}

.jtr-progress-inner {
    background: #99cc33;
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

.jtr-progress-text {
    font-size: 0.95em;
    margin-top: 4px;
    text-align: center;
    color: #444;
}

/* ===== Responsive ===== */
@media (max-width: 1400px) {
    .jtr-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1200px) {
    .jtr-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .jtr-grid { grid-template-columns: repeat(2, 1fr); }
    .jtr-filters { flex-wrap: wrap; }
    .jtr-filter-select { flex: unset; min-width: 100%; }
}
@media (max-width: 576px) {
    .jtr-grid { grid-template-columns: 1fr; }
}
