/**
 * Concorsi Scadenza Oggi - Plugin CSS
 * Versione: 2.0.0
 * Concorsando.it
 */

/* ====================================
   VARIABILI
   ==================================== */
:root {
    --cso-green: #4faf6c;
    --cso-green-dark: #3d8c55;
    --cso-red: #e8523d;
    --cso-red-dark: #c9302c;
    --cso-orange: #ff9800;
    --cso-gray-light: #f9f9f9;
    --cso-text-dark: #333333;
}

/* ====================================
   CONTAINER LISTA
   ==================================== */
.cso-lista-concorsi {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* ====================================
   CONTATORE BOX
   ==================================== */
.cso-contatore-box {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.cso-contatore-item {
    background: white;
    border: 3px solid var(--cso-red);
    border-radius: 16px;
    padding: 25px 40px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(232, 82, 61, 0.2);
    animation: cso-fadeIn 0.6s ease-out;
}

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

.cso-contatore-numero {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--cso-red);
    line-height: 1;
    margin-bottom: 8px;
}

.cso-contatore-label {
    font-size: 1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.cso-contatore-inline {
    display: inline-block;
    background: var(--cso-red);
    color: white;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: inherit;
}

/* ====================================
   CARD CONCORSO
   ==================================== */
.cso-concorso-card {
    background: white;
    border: 2px solid var(--cso-red);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 0 6px 20px rgba(232, 82, 61, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cso-slideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.cso-concorso-card:nth-child(2) { animation-delay: 0.1s; }
.cso-concorso-card:nth-child(3) { animation-delay: 0.2s; }
.cso-concorso-card:nth-child(4) { animation-delay: 0.3s; }
.cso-concorso-card:nth-child(5) { animation-delay: 0.4s; }

@keyframes cso-slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cso-concorso-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(232, 82, 61, 0.25);
}

/* Card scaduta */
.cso-concorso-card.scaduta {
    border-color: #999;
    opacity: 0.7;
}

/* ====================================
   BADGE URGENTE
   ==================================== */
.cso-badge-urgente {
    position: absolute;
    top: -12px;
    right: 25px;
    background: linear-gradient(135deg, var(--cso-red), #ff6b5b);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(232, 82, 61, 0.4);
    animation: cso-pulse 2s infinite;
}

@keyframes cso-pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 4px 12px rgba(232, 82, 61, 0.4);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 6px 16px rgba(232, 82, 61, 0.5);
    }
}

.cso-badge-urgente.scaduto {
    background: linear-gradient(135deg, #666, #888);
    animation: none;
}

/* ====================================
   TITOLO CONCORSO
   ==================================== */
.cso-concorso-titolo {
    font-size: 1.35rem;
    color: var(--cso-text-dark);
    margin: 15px 0 12px 0;
    line-height: 1.4;
    font-weight: 700;
}

.cso-concorso-titolo a {
    color: var(--cso-text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.cso-concorso-titolo a:hover {
    color: var(--cso-green);
}

/* ====================================
   ENTE
   ==================================== */
.cso-concorso-ente {
    color: #555;
    font-size: 1rem;
    margin: 0 0 15px 0;
}

/* ====================================
   TIMER URGENTE
   ==================================== */
.cso-timer {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 2px solid var(--cso-orange);
    border-radius: 10px;
    padding: 14px 20px;
    margin: 18px 0;
    display: inline-block;
    font-weight: 600;
    color: #e65100;
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

/* Timer critico (meno di 2 ore) */
.cso-timer.critico {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-color: var(--cso-red);
    color: var(--cso-red-dark);
    animation: cso-blink 1s ease-in-out infinite;
}

@keyframes cso-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Timer scaduto */
.cso-timer.scaduto {
    background: #f5f5f5;
    border-color: #999;
    color: #666;
    animation: none;
}

/* ====================================
   SCADENZA
   ==================================== */
.cso-scadenza {
    color: #666;
    margin: 15px 0;
    font-size: 1rem;
}

/* ====================================
   PULSANTI CTA
   ==================================== */
.cso-btn-candidati {
    display: inline-block;
    background: linear-gradient(135deg, var(--cso-green), var(--cso-green-dark));
    color: white !important;
    padding: 16px 35px;
    border-radius: 30px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 175, 108, 0.35);
}

.cso-btn-candidati:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 175, 108, 0.45);
    color: white !important;
    text-decoration: none !important;
}

.cso-btn-altri {
    display: inline-block;
    background: #f5f5f5;
    color: #666 !important;
    padding: 14px 30px;
    border-radius: 30px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 10px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.cso-btn-altri:hover {
    background: #eee;
    border-color: #ccc;
    color: #555 !important;
}

/* ====================================
   NESSUN CONCORSO
   ==================================== */
.cso-nessun-concorso {
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 16px;
    margin: 30px 0;
    border: 2px solid var(--cso-green);
    animation: cso-fadeIn 0.6s ease-out;
}

.cso-nessun-concorso .cso-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
    display: block;
}

.cso-nessun-concorso h3 {
    color: var(--cso-green-dark);
    margin: 0 0 15px 0;
    font-size: 1.5rem;
}

.cso-nessun-concorso p {
    color: #555;
    margin: 10px 0;
    font-size: 1.05rem;
}

.cso-nessun-concorso a {
    color: var(--cso-green);
    font-weight: 600;
}

.cso-nessun-concorso a:hover {
    color: var(--cso-green-dark);
}

/* ====================================
   DATA OGGI (per lo shortcode [data_oggi])
   ==================================== */
.cso-data-oggi {
    font-weight: 700;
}

/* ====================================
   RESPONSIVE - TABLET
   ==================================== */
@media (max-width: 992px) {
    .cso-contatore-item {
        padding: 20px 30px;
    }
    
    .cso-contatore-numero {
        font-size: 2.8rem;
    }
    
    .cso-concorso-card {
        padding: 25px;
    }
}

/* ====================================
   RESPONSIVE - MOBILE
   ==================================== */
@media (max-width: 768px) {
    .cso-lista-concorsi {
        padding: 10px 0;
    }
    
    .cso-contatore-item {
        padding: 18px 25px;
        width: 100%;
        max-width: 280px;
    }
    
    .cso-contatore-numero {
        font-size: 2.5rem;
    }
    
    .cso-contatore-label {
        font-size: 0.9rem;
    }
    
    .cso-concorso-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .cso-badge-urgente {
        position: relative;
        top: 0;
        right: 0;
        display: inline-block;
        margin-bottom: 15px;
    }
    
    .cso-concorso-titolo {
        font-size: 1.2rem;
    }
    
    .cso-timer {
        display: block;
        text-align: center;
    }
    
    .cso-btn-candidati,
    .cso-btn-altri {
        display: block;
        text-align: center;
        padding: 14px 25px;
    }
    
    .cso-nessun-concorso {
        padding: 40px 20px;
    }
    
    .cso-nessun-concorso .cso-emoji {
        font-size: 4rem;
    }
}

/* ====================================
   ACCESSIBILITÀ
   ==================================== */
.cso-btn-candidati:focus,
.cso-btn-altri:focus,
.cso-concorso-titolo a:focus {
    outline: 3px solid var(--cso-green);
    outline-offset: 2px;
}

/* Rispetta preferenze utente per animazioni ridotte */
@media (prefers-reduced-motion: reduce) {
    .cso-concorso-card,
    .cso-contatore-item,
    .cso-nessun-concorso {
        animation: none;
    }
    
    .cso-badge-urgente {
        animation: none;
    }
    
    .cso-timer.critico {
        animation: none;
    }
}

/* ====================================
   PRINT
   ==================================== */
@media print {
    .cso-badge-urgente,
    .cso-btn-candidati,
    .cso-btn-altri {
        display: none;
    }
    
    .cso-concorso-card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}
