/* YouTube Latest Video Player Styles - Updated for centering v2.0 */

.ylvp-container {
    margin: 20px 0;
    padding: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Responsive video wrapper - 16:9 aspect ratio */
.ylvp-video-wrapper {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
    overflow: hidden !important;
    background: #1a1a1a;
}

.ylvp-video-wrapper iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override conflicting YouTube lazy-load plugins (e.g., WP YouTube Lyte) */
.ylvp-container .lyte-wrapper,
.ylvp-video-wrapper .lyte-wrapper {
    width: 80% !important;
    max-width: 80% !important;
    margin: 0 auto !important;
}

.ylvp-container iframe[src*="youtube.com"],
.ylvp-container iframe[src*="youtu.be"] {
    width: 100% !important;
    max-width: 100% !important;
}

.ylvp-video-info {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.ylvp-video-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.ylvp-error {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: 500;
}

/* Upcoming video and countdown styles */
.ylvp-upcoming {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ylvp-countdown-wrapper {
    padding: 30px 20px;
    text-align: center;
}

.ylvp-upcoming-info {
    margin-bottom: 30px;
}

.ylvp-upcoming-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 400;
    color: #ffffff;
    opacity: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.ylvp-upcoming .ylvp-video-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.ylvp-countdown {
    margin: 30px 0;
}

.ylvp-countdown-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ylvp-time-unit {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px 15px;
    min-width: 80px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ylvp-time-unit span {
    display: block;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ylvp-time-unit label {
    display: block;
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.ylvp-countdown-message {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
}

.ylvp-countdown-complete {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    animation: ylvp-pulse 2s infinite;
}

@keyframes ylvp-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.ylvp-video-placeholder {
    position: relative;
    margin-top: 30px;
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.ylvp-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.8;
}

.ylvp-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    animation: ylvp-clock-pulse 2s infinite;
}

@keyframes ylvp-clock-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.ylvp-live-indicator {
    display: inline-block;
    background: #ff4444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 8px;
    animation: ylvp-pulse 1.5s infinite;
}

.ylvp-refresh-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

.ylvp-refresh-btn:hover {
    background: #45a049;
}

.ylvp-auto-refresh {
    background: #2196F3;
    animation: ylvp-pulse 2s infinite;
}

.ylvp-auto-refresh:hover {
    background: #1976D2;
}

/* Loading state */
.ylvp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f5f5f5;
    border-radius: 8px;
    margin: 20px 0;
}

.ylvp-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff0000;
    border-radius: 50%;
    animation: ylvp-spin 1s linear infinite;
}

@keyframes ylvp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .ylvp-container {
        margin: 15px 0;
        border-radius: 4px;
    }

    .ylvp-video-info {
        padding: 12px 15px;
    }

    .ylvp-video-title {
        font-size: 16px;
    }

    .ylvp-countdown-wrapper {
        padding: 20px 15px;
    }

    .ylvp-countdown-display {
        gap: 10px;
    }

    .ylvp-time-unit {
        min-width: 60px;
        padding: 15px 10px;
    }

    .ylvp-time-unit span {
        font-size: 22px;
    }

    .ylvp-upcoming-title {
        font-size: 16px;
    }

    .ylvp-upcoming .ylvp-video-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .ylvp-container {
        margin: 10px 0;
        border-radius: 0;
        box-shadow: none;
        border: 1px solid #e0e0e0;
    }

    .ylvp-video-info {
        padding: 10px 12px;
    }

    .ylvp-video-title {
        font-size: 15px;
    }
}


/* Admin page styles */
.ylvp-usage-info {
    background: #f1f1f1;
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.ylvp-usage-info h3 {
    margin-top: 0;
    color: #23282d;
}

.ylvp-usage-info h4 {
    margin-bottom: 8px;
    color: #23282d;
}

.ylvp-usage-info code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    border: 1px solid #ddd;
}

.ylvp-usage-info ul {
    margin-left: 20px;
}

.ylvp-usage-info li {
    margin-bottom: 5px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ylvp-container {
        background: #2d2d2d;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .ylvp-video-info {
        background: #3a3a3a;
        border-top-color: #555;
    }

    .ylvp-video-title {
        color: #fff;
    }

    .ylvp-error {
        background: #3d3d3d;
        border-color: #666;
        color: #ffa500;
    }

    .ylvp-loading {
        background: #2d2d2d;
    }
}