/* Countdown Plugin CSS */
.countdown-wrapper {
    position: relative;
    border: 2px dashed transparent;
    transition: border-color 0.3s ease;
}

/* CKEditor specific styling - make it more visible for editing */
.cke_editable .countdown-wrapper {
    border: 2px dashed #ccc;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    position: relative;
}

.cke_editable .countdown-wrapper:hover {
    border-color: #999;
    background: #f0f0f0;
    cursor: pointer;
}

.cke_editable .countdown-wrapper:before {
    content: "🕐 ODBROJAVANJE - Klikni za uređivanje ili Delete za brisanje";
    position: absolute;
    top: -20px;
    left: 0;
    background: #333;
    color: white;
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cke_editable .countdown-wrapper:hover:before {
    opacity: 1;
}

.countdown-timer {
    font-family: 'Arial', sans-serif;
    max-width: 100%;
}

.countdown-title {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: bold;
    margin-bottom: clamp(8px, 1.5vw, 12px);
    color: #333;
}

.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(8px, 2vw, 15px);
    flex-wrap: wrap;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: clamp(50px, 8vw, 80px);
}

.countdown-number {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: bold;
    line-height: 1;
    color: #2c3e50;
}

.countdown-label {
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: clamp(5px, 1vw, 10px);
    color: #7f8c8d;
}

/* Preview info - only visible in CKEditor */
.countdown-preview-info {
    display: block;
}

/* Hide preview info on frontend */
.countdown-wrapper:not(.cke_editable *) .countdown-preview-info {
    display: none !important;
}

/* Classic Style */
.countdown-style-classic .countdown-number {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: clamp(8px, 1.5vw, 12px);
    border-radius: 5px;
    border: 2px solid #dee2e6;
    min-width: clamp(50px, 8vw, 80px);
    text-align: center;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
}

.countdown-style-classic .countdown-unit {
    margin: 0 5px;
}

/* Modern Style */
.countdown-style-modern .countdown-unit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: clamp(10px, 2vw, 18px) clamp(8px, 1.5vw, 12px);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 0 clamp(3px, 1vw, 8px);
    min-width: clamp(70px, 10vw, 100px);
}

.countdown-style-modern .countdown-number {
    color: white;
    font-size: clamp(2.2rem, 4.5vw, 4rem);
}

.countdown-style-modern .countdown-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Minimal Style */
.countdown-style-minimal .countdown-display {
    gap: clamp(15px, 3vw, 25px);
}

.countdown-style-minimal .countdown-number {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 300;
    color: #e74c3c;
}

.countdown-style-minimal .countdown-label {
    color: #95a5a6;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    font-weight: normal;
}

.countdown-style-minimal .countdown-unit::after {
    content: ':';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2em;
    color: #bdc3c7;
}

.countdown-style-minimal .countdown-unit:last-child::after {
    display: none;
}

.countdown-style-minimal .countdown-unit {
    position: relative;
}

/* Expired state */
.countdown-expired {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #e74c3c;
    padding: 20px;
    background: #ffeaa7;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

/* Responsive design - works on all screen sizes */
.countdown-wrapper {
    width: 100%;
    max-width: min(90vw, 800px);
    margin: 10px auto;
}

/* Ensure readability on very small screens */
@media (max-width: 320px) {
    .countdown-display {
        flex-direction: column;
        gap: clamp(10px, 3vw, 20px);
    }
    
    .countdown-unit {
        width: 100%;
        max-width: 120px;
    }
}

/* CKEditor specific styles */
.cke_dialog_body .cke_dialog_ui_text input {
    width: 100% !important;
}

/* Toolbar icon */
.cke_button__countdown_icon {
    background-image: url('icons/countdown.png') !important;
    background-size: 16px 16px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}