/* Premium Widget UI */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&display=swap');

:root {
    --wprp-widget-bg: rgba(255, 255, 255, 0.95);
    --wprp-widget-text: #0f172a;
    --wprp-widget-muted: #64748b;
    --wprp-widget-border: rgba(226, 232, 240, 0.8);
    --wprp-widget-accent: linear-gradient(135deg, #6366f1, #8b5cf6);
    --wprp-widget-live: linear-gradient(135deg, #ef4444, #f97316);
    --wprp-widget-radius: 16px;
    --wprp-shadow: 0 10px 30px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.01);
}

.wprp-theme-dark {
    --wprp-widget-bg: rgba(15, 23, 42, 0.95);
    --wprp-widget-text: #f8fafc;
    --wprp-widget-muted: #94a3b8;
    --wprp-widget-border: rgba(51, 65, 85, 0.8);
    --wprp-shadow: 0 10px 30px -5px rgba(0,0,0,0.3);
}

.wprp-schedule-container {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: var(--wprp-widget-bg);
    color: var(--wprp-widget-text);
    border-radius: var(--wprp-widget-radius);
    padding: 24px;
    box-shadow: var(--wprp-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    box-sizing: border-box;
    width: 100%;
}

.wprp-widget-container {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    box-sizing: border-box;
    width: 100%;
}

.wprp-widget-container *,
.wprp-schedule-container * {
    box-sizing: border-box;
}

.wprp-loading {
    text-align: center;
    padding: 30px;
    color: var(--wprp-widget-muted);
    font-size: 15px;
    font-weight: 500;
}

.wprp-program-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    width: 100%;
    box-sizing: border-box;
}

.wprp-theme-dark .wprp-program-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.wprp-program-card:last-child {
    margin-bottom: 0;
}

.wprp-program-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

.wprp-program-img, .wprp-program-img-fallback {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.wprp-program-img-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.wprp-program-details {
    flex: 1;
    min-width: 0;
}

@keyframes wprp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.wprp-program-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.wprp-status-live {
    background: var(--wprp-widget-live);
    color: white;
    animation: wprp-pulse 2s infinite;
}

.wprp-status-next {
    background: var(--wprp-widget-accent);
    color: white;
}

.wprp-status-later {
    background: rgba(100, 116, 139, 0.1);
    color: var(--wprp-widget-text);
}

.wprp-program-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.3;
    word-break: break-word;
    color: var(--wprp-widget-text) !important;
}

.wprp-program-time {
    font-size: 13px;
    color: var(--wprp-widget-muted) !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.wprp-program-time::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Schedule full layout (Tabs) */
.wprp-schedule-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.wprp-schedule-tabs::-webkit-scrollbar {
    height: 4px;
}
.wprp-schedule-tabs::-webkit-scrollbar-thumb {
    background: var(--wprp-widget-border);
    border-radius: 4px;
}

.wprp-tab-btn {
    background: transparent;
    border: 1px solid var(--wprp-widget-border);
    color: var(--wprp-widget-muted) !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.wprp-tab-btn:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--wprp-widget-text) !important;
}
.wprp-tab-btn.active {
    background: var(--wprp-widget-accent);
    color: white !important;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.wprp-tab-pane {
    display: none;
    animation: wprpFadeIn 0.3s ease;
}
.wprp-tab-pane.active {
    display: block;
}

@keyframes wprpFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.wprp-programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.wprp-card-large {
    align-items: flex-start;
}
.wprp-card-large .wprp-program-img,
.wprp-card-large .wprp-program-img-fallback {
    width: 100px;
    height: 100px;
    font-size: 40px;
}
.wprp-card-large .wprp-program-title {
    font-size: 18px;
}

.wprp-card-live {
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.03) !important;
}
.wprp-theme-dark .wprp-card-live {
    background: rgba(239, 68, 68, 0.1) !important;
}

.wprp-program-desc {
    font-size: 13px;
    color: var(--wprp-widget-muted) !important;
    margin-top: 6px;
    line-height: 1.4;
}

.wprp-empty-day {
    text-align: center;
    padding: 40px 20px;
    color: var(--wprp-widget-muted) !important;
    font-size: 15px;
    font-weight: 500;
    background: rgba(0,0,0,0.02);
    border: 1px dashed var(--wprp-widget-border);
}

/* Horizontal Layout Styles */
.wprp-horizontal-bar {
    display: flex;
    align-items: center;
    background: #fcfcfc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-height: 110px;
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.05);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.wprp-horizontal-bar::-webkit-scrollbar {
    height: 4px;
}
.wprp-horizontal-bar::-webkit-scrollbar-track {
    background: transparent;
}
.wprp-horizontal-bar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.wprp-horiz-item {
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-right: 1px solid #f1f5f9;
    flex: 0 0 auto;
    width: var(--wprp-horiz-width, 320px);
    min-width: 0;
    transition: background 0.3s ease;
}

.wprp-horiz-item:hover {
    background: #f8fafc;
}

.wprp-horiz-item:last-child {
    border-right: none;
}

.wprp-horiz-live {
    flex: 0 0 auto;
    width: 380px;
    background: #f1f5f9;
    position: relative;
    border-right: 2px solid #e2e8f0;
}

.wprp-horiz-img-wrap {
    flex-shrink: 0;
}

.wprp-horizontal-bar .wprp-horiz-img, 
.wprp-horizontal-bar .wprp-horiz-img-wrap div.wprp-program-img-fallback {
    width: 90px !important;
    height: 90px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.wprp-horiz-content {
    flex: 1;
    min-width: 0;
}

.wprp-horiz-label {
    font-size: 10px;
    font-weight: 900;
    color: #ef4444;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.wprp-horiz-label.live {
    background: #ef4444;
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    margin-bottom: 8px;
}

.wprp-horiz-title {
    font-size: 19px;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
}

.wprp-horiz-time {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    margin-top: 4px;
}

.wprp-horiz-play {
    width: 48px;
    height: 48px;
    background: #ef4444;
    border: none;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    box-shadow: 0 6px 12px -2px rgba(239, 68, 68, 0.4);
}

.wprp-horiz-play:hover {
    background: #dc2626;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 16px -2px rgba(239, 68, 68, 0.5);
}

.wprp-horiz-play svg {
    width: 28px;
    height: 28px;
}

/* Dark mode adjustments */
.wprp-theme-dark .wprp-horizontal-bar {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.5);
}

.wprp-theme-dark .wprp-horiz-item {
    border-color: #334155;
}

.wprp-theme-dark .wprp-horiz-item:hover {
    background: #334155;
}

.wprp-theme-dark .wprp-horiz-live {
    background: #0f172a;
    border-right-color: #334155;
}

.wprp-theme-dark .wprp-horiz-title {
    color: #f1f5f9;
}

.wprp-theme-dark .wprp-horiz-time {
    color: #94a3b8;
}

@media (max-width: 900px) {
    .wprp-horiz-item {
        padding: 15px 20px;
        gap: 15px;
    }
    .wprp-horiz-title {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .wprp-horizontal-bar {
        flex-direction: column;
        border-radius: 12px;
    }
    .wprp-horiz-item {
        border-right: none;
        border-bottom: 1px solid #d1d5db;
        width: 100%;
        padding: 20px;
    }
    .wprp-theme-dark .wprp-horiz-item {
        border-bottom-color: #374151;
    }
}

/* Nav Buttons */
.wprp-horiz-nav {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    pointer-events: none;
    z-index: 10;
}

.wprp-nav-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.wprp-nav-btn:hover {
    background: #fff;
    color: #0f172a;
    transform: scale(1.1);
}

.wprp-nav-btn svg {
    width: 20px;
    height: 20px;
}

.wprp-theme-dark .wprp-nav-btn {
    background: rgba(15, 23, 42, 0.9);
    border-color: #334155;
    color: #94a3b8;
}

.wprp-theme-dark .wprp-nav-btn:hover {
    background: #1e293b;
    color: #f1f5f9;
}
