/* Timer principal */
.wc-timer {
    --timer-primary: #3D5AFE;
    --timer-secondary: #2979FF;
    --timer-text: #333333;
    --timer-light: #FFFFFF;
    --timer-bg: #F5F7FF;
    --timer-border: #E1E5F2;
    --timer-shadow: rgba(61, 90, 254, 0.2);
    --timer-attention: #FF9500;
    --timer-urgent: #FF3B30;
    --timer-expired: #FF3B30;
    
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: var(--timer-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--timer-shadow);
    padding: 12px 16px;
    margin: 15px 0;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Timer com ênfase de atenção (menos de 1 dia) */
.wc-timer.wc-timer-attention {
    --timer-primary: var(--timer-attention);
    --timer-secondary: var(--timer-attention);
    --timer-shadow: rgba(255, 149, 0, 0.2);
    animation: pulse-attention 2s infinite;
}

/* Timer com ênfase de urgência (menos de 1 hora) */
.wc-timer.wc-timer-urgent {
    --timer-primary: var(--timer-urgent);
    --timer-secondary: var(--timer-urgent);
    --timer-shadow: rgba(255, 59, 48, 0.2);
    animation: pulse-urgent 1.5s infinite;
}

/* Animações de pulso */
@keyframes pulse-attention {
    0% { box-shadow: 0 4px 12px rgba(255, 149, 0, 0.2); }
    50% { box-shadow: 0 4px 18px rgba(255, 149, 0, 0.4); }
    100% { box-shadow: 0 4px 12px rgba(255, 149, 0, 0.2); }
}

@keyframes pulse-urgent {
    0% { box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(255, 59, 48, 0.5); }
    100% { box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3); }
}

/* Cabeçalho do timer */
.wc-timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wc-timer-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--timer-text);
    margin: 0;
}

.wc-timer-toggle {
    background: none;
    border: none;
    color: var(--timer-primary);
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.wc-timer-toggle:hover {
    opacity: 1;
}

/* Contêiner dos números */
.wc-timer-digits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 -5px;
}

/* Unidade de tempo (dias, horas, etc) */
.wc-timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    perspective: 400px;
}

/* Animação de flip */
.wc-timer-unit.flip .wc-timer-box {
    transform: rotateX(90deg);
    transition: transform 0.15s ease-out;
}

/* Caixa do número */
.wc-timer-box {
    background: linear-gradient(135deg, var(--timer-primary), var(--timer-secondary));
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-in;
}

/* Reflexo na caixa do número */
.wc-timer-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    pointer-events: none;
}

/* Número do timer */
.wc-timer-number {
    color: var(--timer-light);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Rótulo da unidade de tempo */
.wc-timer-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--timer-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    opacity: 0.7;
}

/* Separador entre unidades */
.wc-timer-separator {
    color: var(--timer-primary);
    font-size: 20px;
    font-weight: 700;
    line-height: 40px;
    height: 40px;
    margin-top: 0;
    display: flex;
    align-items: center;
}

/* Mensagem (ex: expirado) */
.wc-timer-message {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 10px;
    border-radius: 6px;
}

.wc-timer-expired-message {
    color: white;
    background: var(--timer-expired);
    animation: appear 0.3s ease-out;
}

@keyframes appear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Modo compacto para espaços menores */
.wc-timer.wc-timer-compact {
    padding: 8px 12px;
}

.wc-timer.wc-timer-compact .wc-timer-header {
    margin-bottom: 6px;
}

.wc-timer.wc-timer-compact .wc-timer-box {
    width: 36px;
    height: 36px;
}

.wc-timer.wc-timer-compact .wc-timer-number {
    font-size: 18px;
}

.wc-timer.wc-timer-compact .wc-timer-separator {
    font-size: 18px;
    line-height: 36px;
    height: 36px;
}

.wc-timer.wc-timer-compact .wc-timer-label {
    font-size: 9px;
    margin-top: 3px;
}

/* Versão super compacta para widgets e colunas estreitas */
@media (max-width: 360px) {
    .wc-timer {
        padding: 8px;
    }
    
    .wc-timer-box {
        width: 32px;
        height: 32px;
    }
    
    .wc-timer-number {
        font-size: 16px;
    }
    
    .wc-timer-separator {
        font-size: 16px;
        line-height: 32px;
        height: 32px;
    }
    
    .wc-timer-label {
        font-size: 8px;
    }
    
    .wc-timer-digits {
        gap: 5px;
    }
}

/* Layout responsivo para telas pequenas */
@media (max-width: 480px) {
    .wc-timer {
        padding: 10px 12px;
    }
    
    .wc-timer-title {
        font-size: 13px;
    }
}

/* Layout específico para dispositivos muito pequenos ou widgets laterais */
@media (max-width: 320px) {
    .wc-timer-box {
        width: 28px;
        height: 28px;
    }
    
    .wc-timer-number {
        font-size: 14px;
    }
    
    .wc-timer-separator {
        font-size: 14px;
        line-height: 28px;
        height: 28px;
    }
    
    .wc-timer-label {
        font-size: 7px;
    }
    
    .wc-timer-digits {
        gap: 3px;
    }
}

/* Para telas muito grandes, fazer o timer um pouco maior */
@media (min-width: 1200px) {
    .wc-timer-box {
        width: 50px;
        height: 50px;
    }
    
    .wc-timer-number {
        font-size: 24px;
    }
    
    .wc-timer-separator {
        font-size: 24px;
        line-height: 50px;
        height: 50px;
    }
}