/**
 * OTO Timer Styles v5.0
 */

/* Base styles */
.oto-timer {
    display: inline-block;
    padding: 20px;
    margin: 10px auto;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    
    .oto-style-modern .oto-number {
        font-size: 1.5em;
        padding: 5px 10px;
    }
    
    .oto-popup-timer .oto-number {
        font-size: 1.3em;
        padding: 4px 8px;
    }
    
    .oto-style-gradient .oto-gradient-number {
        font-size: 2em;
    }
    
    .oto-popup-timer .oto-gradient-number {
        font-size: 1.6em;
    }
    
    .oto-style-neon .oto-neon-number {
        font-size: 2em;
    }
    
    .oto-popup-timer .oto-neon-number {
        font-size: 1.6em;
    }
    
    .oto-style-flip .oto-flip-card {
        width: 50px;
        height: 60px;
    }
    
    .oto-popup-timer .oto-flip-card {
        width: 40px;
        height: 50px;
    }
    
    .oto-style-flip .oto-flip-top,
    .oto-style-flip .oto-flip-bottom {
        font-size: 2em;
    }
    
    .oto-popup-timer .oto-flip-top,
    .oto-popup-timer .oto-flip-bottom {
        font-size: 1.6em;
    }
}

/* Container per centrare il timer */
[id^="oto-timer-"] {
    text-align: center;
    width: 100%;
}

/* Popup Styles */
.oto-popup-wrapper {
    animation: otoSlideIn 0.3s ease-out;
    max-width: 90%;
    max-width: min(90%, 400px);
}

.oto-popup-inner {
    position: relative;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: visible;
}

.oto-popup-timer {
    padding: 15px !important;
    margin: 0 !important;
}

.oto-popup-timer.oto-timer {
    display: block;
    width: auto;
}

/* Popup text styles */
.oto-popup-text {
    line-height: 1.4;
    word-wrap: break-word;
}

/* Popup close button hover */
.oto-popup-close {
    transition: all 0.2s ease;
}

.oto-popup-close:hover {
    background: #555 !important;
    transform: scale(1.1);
}

/* Tooltip for close button */
.oto-popup-close:hover::before {
    content: 'Nascondi timer';
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0.9;
}

/* Reopen Widget Styles */
.oto-reopen-widget {
    animation: otoFadeIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.oto-reopen-widget:hover .oto-reopen-inner {
    background: #555 !important;
    transform: scale(1.05);
}

.oto-reopen-inner {
    transition: all 0.2s ease;
    cursor: pointer;
}

.oto-reopen-show {
    animation: otoBounceIn 0.5s ease-out;
}

@keyframes otoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes otoBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Animazioni popup in base alla posizione */
@keyframes otoSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oto-popup-top-left,
.oto-popup-top-right {
    animation: otoSlideInTop 0.3s ease-out;
}

.oto-popup-bottom-left,
.oto-popup-bottom-right {
    animation: otoSlideInBottom 0.3s ease-out;
}

@keyframes otoSlideInTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes otoSlideInBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shape variations */
.oto-shape-rounded {
    border-radius: 10px;
}

.oto-shape-square {
    border-radius: 0;
}

.oto-shape-circle {
    border-radius: 50%;
    padding: 40px;
}

.oto-popup-timer.oto-shape-circle {
    padding: 30px !important;
}

.oto-shape-circle .oto-unit,
.oto-shape-circle .oto-gradient-unit,
.oto-shape-circle .oto-neon-unit,
.oto-shape-circle .oto-flip-unit {
    margin: 0 10px;
}

.oto-shape-hexagon {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    padding: 40px 30px;
}

.oto-popup-timer.oto-shape-hexagon {
    padding: 30px 20px !important;
}

/* Modern Style */
.oto-style-modern .oto-timer-inner {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.oto-popup-timer .oto-timer-inner {
    gap: 10px;
}

.oto-style-modern .oto-unit {
    text-align: center;
}

.oto-style-modern .oto-number {
    font-size: 2em;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.oto-popup-timer .oto-number {
    font-size: 1.6em;
    padding: 8px 12px;
}

.oto-style-modern .oto-label {
    font-size: 0.8em;
    text-transform: uppercase;
}

.oto-popup-timer .oto-label {
    font-size: 0.7em;
}

/* Classic Style */
.oto-style-classic .oto-timer-classic {
    font-size: 1.2em;
    line-height: 1.8;
}

.oto-popup-timer .oto-timer-classic {
    font-size: 1em;
}

.oto-style-classic .oto-value {
    font-weight: bold;
    font-size: 1.3em;
}

/* Minimal Style */
.oto-style-minimal .oto-timer-minimal {
    font-family: 'Courier New', monospace;
    font-size: 2em;
    letter-spacing: 0.1em;
}

.oto-popup-timer .oto-timer-minimal {
    font-size: 1.6em;
}

/* Gradient Style */
.oto-style-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.oto-style-gradient .oto-timer-gradient {
    display: flex;
    align-items: center;
    justify-content: center;
}

.oto-style-gradient .oto-gradient-unit {
    padding: 0 15px;
}

.oto-popup-timer .oto-gradient-unit {
    padding: 0 10px;
}

.oto-style-gradient .oto-gradient-number {
    font-size: 2.5em;
    font-weight: bold;
    line-height: 1;
}

.oto-popup-timer .oto-gradient-number {
    font-size: 2em;
}

.oto-style-gradient .oto-gradient-label {
    font-size: 0.7em;
    text-transform: uppercase;
    opacity: 0.8;
}

.oto-style-gradient .oto-gradient-separator {
    font-size: 2em;
    margin: 0 5px;
}

.oto-popup-timer .oto-gradient-separator {
    font-size: 1.6em;
    margin: 0 3px;
}

/* Neon Style */
.oto-style-neon {
    background: #000;
    color: #0ff;
}

.oto-style-neon .oto-timer-neon {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.oto-popup-timer .oto-timer-neon {
    gap: 15px;
}

.oto-style-neon .oto-neon-unit {
    text-align: center;
}

.oto-style-neon .oto-neon-number {
    font-size: 3em;
    font-weight: bold;
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
}

.oto-popup-timer .oto-neon-number {
    font-size: 2.4em;
}

.oto-style-neon .oto-neon-label {
    font-size: 0.6em;
    letter-spacing: 0.2em;
    margin-top: 5px;
}

/* Flip Style */
.oto-style-flip .oto-timer-flip {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.oto-popup-timer .oto-timer-flip {
    gap: 8px;
}

.oto-style-flip .oto-flip-unit {
    text-align: center;
}

.oto-style-flip .oto-flip-card {
    width: 60px;
    height: 70px;
    position: relative;
    perspective: 1000px;
}

.oto-popup-timer .oto-flip-card {
    width: 50px;
    height: 60px;
}

.oto-style-flip .oto-flip-top,
.oto-style-flip .oto-flip-bottom {
    position: absolute;
    width: 100%;
    height: 50%;
    overflow: hidden;
    background: #333;
    color: white;
    font-size: 2.5em;
    line-height: 1.4;
    font-weight: bold;
}

.oto-popup-timer .oto-flip-top,
.oto-popup-timer .oto-flip-bottom {
    font-size: 2em;
}

.oto-style-flip .oto-flip-top {
    top: 0;
    border-radius: 4px 4px 0 0;
    border-bottom: 1px solid #666;
}

.oto-style-flip .oto-flip-bottom {
    bottom: 0;
    border-radius: 0 0 4px 4px;
    line-height: 0;
}

.oto-style-flip .oto-flip-label {
    margin-top: 5px;
    font-size: 0.8em;
}

.oto-popup-timer .oto-flip-label {
    font-size: 0.7em;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255,255,255,0.5); }
    50% { box-shadow: 0 0 20px rgba(255,255,255,0.8); }
}

.oto-animation-pulse {
    animation: pulse 2s infinite;
}

.oto-animation-bounce {
    animation: bounce 2s infinite;
}

.oto-animation-shake {
    animation: shake 0.5s infinite;
}

.oto-animation-glow {
    animation: glow 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .oto-timer {
        padding: 15px;
    }
    
    .oto-popup-timer {
        padding: 12px !important;
    }
    
    .oto-popup-wrapper {
        max-width: min(85%, 350px);
    }
    
    .oto-popup-text {
        font-size: 16px !important;
        padding: 8px !important;
    }
    
    .oto-reopen-inner {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    
    .oto-reopen-inner span:first-child {
        font-size: 16px !important;
    }
    
    .oto-style-modern .oto-timer-inner,
    .oto-style-gradient .oto-timer-gradient,
    .oto-style-neon .oto-timer-neon,
    .oto-style-flip .oto-timer-flip {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .oto-popup-timer .oto-timer-inner,
    .oto-popup-timer .oto-timer-gradient,
    .oto-popup-timer .oto-timer-neon,
    .oto-popup-timer .oto-timer-flip {
        gap: 8px;
    }
    
    .oto-style-modern .oto-unit,
    .oto-style-gradient .oto-gradient-unit,
    .oto-style-neon .oto-neon-unit,
    .oto-style-flip .oto-flip-unit {
        flex: 1 1 40%;
    }
    
    .oto-style-gradient .oto-gradient-separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .oto-popup-wrapper {
        max-width: min(80%, 300px);
        right: 10px !important;
        left: 10px !important;
    }
    
    .oto-popup-text {
        font-size: 14px !important;
        padding: 6px !important;
        margin-bottom: 10px !important;
    }
    
    .oto-reopen-inner {
        font-size: 12px !important;
        padding: 6px 10px !important;
        gap: 5px !important;
    }
    
    .oto-reopen-inner span:first-child {
        font-size: 14px !important;
    }
    
    .oto-popup-top-right,
    .oto-popup-bottom-right {
        right: 10px !important;
    }
    
    .oto-popup-top-left,
    .oto-popup-bottom-left {
        left: 10px !important;
    }
    
    .oto-style-modern .oto-number {
        font-size: 1.5em;
        padding: 5px 10px;
    }
    
    .oto-popup-timer .oto-number {
        font-size: 1.3em;
        padding: 4px 8px;
    }
    
    .oto-style-gradient .oto-gradient-number {
        font-size: 2em;
    }
    
    .oto-popup-timer .oto-gradient-number {
        font-size: 1.6em;
    }
    
    .oto-style-neon .oto-neon-number {
        font-size: 2em;
    }
    
    .oto-popup-timer .oto-neon-number {
        font-size: 1.6em;
    }
    
    .oto-style-flip .oto-flip-card {
        width: 50px;
        height: 60px;
    }
    
    .oto-popup-timer .oto-flip-card {
        width: 40px;
        height: 50px;
    }
    
    .oto-style-flip .oto-flip-top,
    .oto-style-flip .oto-flip-bottom {
        font-size: 2em;
    }
    
    .oto-popup-timer .oto-flip-top,
    .oto-popup-timer .oto-flip-bottom {
        font-size: 1.6em;
    }
    
    
    
    /* Aggiungi questi stili alla fine del file oto-timer-styles.css */

/* Timer Invisibile */
.oto-timer-invisible {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -9999 !important;
}

/* Assicura che anche i popup invisibili siano nascosti */
.oto-popup-wrapper.oto-invisible-popup {
    display: none !important;
    visibility: hidden !important;
}

/* Nasconde anche tutti i figli di timer invisibili */
.oto-timer-invisible * {
    display: none !important;
    visibility: hidden !important;
}

/* Per sicurezza extra in caso di conflitti CSS */
body .oto-timer-invisible,
html .oto-timer-invisible,
#page .oto-timer-invisible,
.site .oto-timer-invisible,
.wrapper .oto-timer-invisible,
.container .oto-timer-invisible,
main .oto-timer-invisible,
article .oto-timer-invisible,
section .oto-timer-invisible,
div .oto-timer-invisible {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
}

/* Stili per l'anteprima admin quando invisibile */
.oto-preview-invisible {
    opacity: 0.3;
    border: 2px dashed #ff9800;
    position: relative;
}

.oto-preview-invisible::before {
    content: "TIMER INVISIBILE";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ff9800;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}
}