/* =============================================================
   WP Concours Vote – Styles Frontend
   ============================================================= */

/* ---- Grille ---- */
.wcv-wrap {
    position: relative;
}

.wcv-grid {
    display: grid;
    gap: 24px;
    padding: 10px 0 30px;
}

.wcv-cols-1 { grid-template-columns: repeat(1, 1fr); }
.wcv-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wcv-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wcv-cols-4 { grid-template-columns: repeat(4, 1fr); }
.wcv-cols-5 { grid-template-columns: repeat(5, 1fr); }
.wcv-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 900px) {
    .wcv-cols-3,
    .wcv-cols-4,
    .wcv-cols-5,
    .wcv-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .wcv-cols-2,
    .wcv-cols-3,
    .wcv-cols-4,
    .wcv-cols-5,
    .wcv-cols-6 {
        grid-template-columns: 1fr;
    }
}

/* ---- Carte candidat ---- */
.wcv-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.wcv-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

/* ---- Image de la carte ---- */
.wcv-card-img {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #e5e7eb;
    aspect-ratio: 4 / 3;
}

.wcv-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.wcv-card-img img {
  min-height: 300px !important;
  object-fit: cover !important;
}
.wcv-zoom-icon img{
 height: 32px !important;
 min-height: 32px !important;
}

.wcv-card-img:hover img {
    transform: scale(1.05);
    filter: brightness(0.88);
}

.wcv-zoom-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.wcv-card-img:hover .wcv-zoom-icon {
    opacity: 1;
}

/* ---- Corps de la carte ---- */
.wcv-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.wcv-card-title {
    margin: 0;
    font-size: 1.05em;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.wcv-card-excerpt {
    margin: 0;
    font-size: 0.875em;
    color: #6b7280;
    line-height: 1.55;
    flex: 1;
}

.wcv-card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ---- Boutons de vote ---- */
.wcv-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.18s, transform 0.12s, border-color 0.18s;
    line-height: 1.4;
    white-space: nowrap;
}

.wcv-btn--vote {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.wcv-btn--vote:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: scale(1.03);
}

.wcv-btn--vote:active:not(:disabled) {
    transform: scale(0.97);
}

.wcv-btn--voted {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
    cursor: default;
}

.wcv-btn--disabled {
    background: #d1d5db;
    color: #6b7280;
    border-color: #d1d5db;
    cursor: not-allowed;
}

.wcv-btn:disabled {
    opacity: 0.8;
}

/* ---- Compteur de votes ---- */
.wcv-count {
    font-size: 0.82em;
    color: #9ca3af;
    font-weight: 500;
}

/* ---- Votes fermés ---- */
.wcv-votes-fermes {
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
}

.wcv-votes-fermes-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.wcv-lock-icon {
    font-size: 2.8rem;
    display: block;
}

.wcv-votes-fermes p {
    margin: 0;
    font-size: 1.15em;
    color: #374151;
    font-weight: 500;
    max-width: 480px;
}

/* ---- Message d'erreur ---- */
.wcv-error {
    padding: 12px 16px;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #dc2626;
    border-radius: 4px;
}

/* =============================================================
   MODAL POPUP
   ============================================================= */

.wcv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    animation: wcvFadeIn 0.18s ease;
}

@keyframes wcvFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.wcv-modal-box {
    background: #ffffff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    animation: wcvSlideUp 0.22s ease;
}

@keyframes wcvSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.wcv-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.08);
    border: none;
    border-radius: 50%;
    font-size: 1.1em;
    cursor: pointer;
    color: #374151;
    z-index: 2;
    transition: background 0.15s;
    line-height: 1;
}

.wcv-modal-close:hover {
    background: rgba(0,0,0,0.18);
}

.wcv-modal-inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 380px;
}

@media (max-width: 640px) {
    .wcv-modal-inner {
        grid-template-columns: 1fr;
    }
}

.wcv-modal-img-wrap {
    overflow: hidden;
    border-radius: 16px 0 0 16px;
    background: #e5e7eb;
}

@media (max-width: 640px) {
    .wcv-modal-img-wrap {
        border-radius: 16px 16px 0 0;
        max-height: 260px;
    }
}

#wcv-modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcv-modal-info {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

@media (max-width: 640px) {
    .wcv-modal-info {
        padding: 24px 20px;
    }
}

#wcv-modal-title {
    margin: 0;
    font-size: 1.55em;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
}

#wcv-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wcv-modal-count {
    font-size: 0.85em;
    color: #9ca3af;
    font-weight: 500;
}

/* =============================================================
   TOAST DE REMERCIEMENT
   ============================================================= */

.wcv-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #16a34a;
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.95em;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    animation: wcvToastIn 0.3s ease;
}

@keyframes wcvToastIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.wcv-toast-icon {
    font-size: 1.25em;
}

@media (max-width: 480px) {
    .wcv-toast {
        bottom: 16px;
        font-size: 0.85em;
        padding: 12px 18px;
        white-space: normal;
        max-width: 90vw;
        border-radius: 12px;
    }
}

/* =============================================================
   DESCRIPTION COMPLETE DANS LE MODAL (scrollable)
   ============================================================= */

#wcv-modal-excerpt {
    margin: 0;
    color: #4b5563;
    font-size: 0.95em;
    line-height: 1.65;
    overflow-y: auto;
    max-height: 220px;
    white-space: pre-line;
}

/* =============================================================
   FORMULAIRE DE VOTE
   ============================================================= */

#wcv-modal-form-wrap {
    width: 100%;
}

.wcv-vote-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wcv-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wcv-form-field label {
    font-size: 0.82em;
    font-weight: 600;
    color: #374151;
}

.wcv-form-field input[type="text"],
.wcv-form-field input[type="email"] {
    padding: 8px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    color: #111827;
    background: #f9fafb;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.wcv-form-field input[type="text"]:focus,
.wcv-form-field input[type="email"]:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
}

.wcv-form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.wcv-form-check input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.wcv-form-check label {
    font-size: 0.8em;
    color: #374151;
    line-height: 1.45;
    cursor: pointer;
}

.wcv-required {
    color: #dc2626;
    font-weight: 700;
}

.wcv-form-error {
    padding: 8px 12px;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    color: #dc2626;
    border-radius: 4px;
    font-size: 0.85em;
}

/* =============================================================
   MESSAGE DE REMERCIEMENT DANS LE MODAL
   ============================================================= */

.wcv-merci-msg {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
    color: #16a34a;
    text-align: center;
    padding: 20px 0;
}
