/* ==================== TIMETABLE BASE STYLES ==================== */

.rod-timetable-wrapper {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==================== HEADER STYLES ==================== */

.rod-timetable-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.rod-time-column-header {
    padding: 20px 15px;
    font-weight: 600;
    background: rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.rod-day-column-header {
    padding: 15px 10px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.rod-day-column-header:last-child {
    border-right: none;
}

.rod-day-column-header.rod-current-day {
    background: rgba(255,255,255,0.2);
    font-weight: 600;
}

.rod-day-name {
    font-size: 14px;
    font-weight: 500;
}

.rod-today-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
}

/* ==================== BODY STYLES ==================== */

.rod-timetable-body {
    max-height: 600px;
    overflow-y: auto;
}

.rod-timetable-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    min-height: 100px;
}

.rod-timetable-row:hover {
    background-color: #f8f9fa;
}

.rod-timetable-row.rod-current-time-slot {
    background-color: #fff3cd;
}

.rod-time-slot-header {
    padding: 15px 10px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #495057;
    position: relative;
    font-size: 14px;
}

.rod-now-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

/* ==================== PROGRAM CELL STYLES ==================== */

.rod-program-cell {
    padding: 12px 8px;
    border-right: 1px solid #e9ecef;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rod-program-cell:last-child {
    border-right: none;
}

.rod-program-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 2;
}

.rod-program-cell.rod-current-cell {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border-left: 3px solid #f39c12 !important;
}

.rod-program-cell.rod-past-program {
    opacity: 0.85;
}

.rod-program-cell.rod-past-program:hover {
    opacity: 0.95;
}

.rod-program-cell.rod-current-program {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    border-left: 3px solid #28a745 !important;
}

.rod-program-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
    align-self: center;
}

.rod-program-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rod-past-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
}

.rod-current-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.rod-program-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==================== PROGRAM CONTENT STYLES ==================== */

.rod-program-title {
    position: static;
    background: none;
    color: #2c3e50;
    padding: 0;
    margin: 0 0 6px 0;
    font-size: 13px;
    line-height: 13px !important;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 5px;
}

.rod-past-badge {
    background: #28a745;
    color: white;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    flex-shrink: 0;
}

.rod-program-hosts {
    margin-bottom: 6px;
}

.rod-host-item {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.rod-host-avatar {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rod-host-name {
    font-size: 10px;
    color: #7f8c8d;
    line-height: 1.2;
}

.rod-program-excerpt {
    font-size: 10px;
    color: #636e72;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    display: none;
}

.rod-program-time {
    font-size: 10px;
    color: #95a5a6;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: auto;
}

.rod-time-range {
    font-weight: 600;
    color: #495057;
}

.rod-date-badge {
    background: #6c757d;
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 500;
    white-space: nowrap;
}

/* ==================== COMPACT VIEW STYLES ==================== */

.rod-compact-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
}

.rod-compact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rod-program-name-compact {
    font-size: 11px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.2;
    text-align: center;
}

.rod-past-indicator {
    color: #6c757d;
    font-weight: bold;
    font-size: 12px;
}

.rod-live-indicator {
    color: #dc3545;
    font-weight: bold;
    font-size: 10px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* ==================== EMPTY CELL STYLES ==================== */

.rod-empty-cell {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.rod-empty-cell:hover {
    background: #e9ecef;
}

/* ==================== MANUAL PROGRAM BADGE STYLES ==================== */

.rod-manual-badge {
    background: #ffc107;
    color: #212529;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 4px;
}

.rod-manual-indicator {
    background: #ffc107;
    color: #212529;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    margin-left: 4px;
}

/* ==================== PLAY ICON ON HOVER FOR PAST PROGRAMS ==================== */

.rod-past-program-thumbnail,
.rod-past-program-no-thumbnail {
    position: relative;
}

.rod-play-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(52, 152, 219, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 4;
    cursor: pointer;
}

.rod-play-hover-icon {
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #3498db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.rod-program-cell.rod-past-program:hover .rod-play-hover-overlay {
    opacity: 1;
}

.rod-program-cell.rod-past-program:hover .rod-play-hover-icon {
    transform: scale(1);
}

/* Untuk past program dengan gambar */
.rod-past-program-thumbnail .rod-play-hover-overlay {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.85) 0%, rgba(41, 128, 185, 0.85) 100%);
}

/* Untuk past program tanpa gambar */
.rod-past-program-no-thumbnail .rod-play-hover-overlay {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.9) 0%, rgba(41, 128, 185, 0.9) 100%);
}

/* Play hover text */
.rod-play-hover-text {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.rod-program-cell.rod-past-program:hover .rod-play-hover-text {
    opacity: 1;
}

/* ==================== PAST PROGRAM STYLES ==================== */

.rod-program-cell.rod-past-program {
    padding: 0 !important;
    background: none !important;
    border-left: 3px solid #6c757d !important;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.rod-past-program-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100px;
    display: flex;
    align-items: flex-end;
}

.rod-past-thumbnail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6) grayscale(0.3);
    z-index: 1;
    transition: filter 0.3s ease;
}

.rod-program-cell.rod-past-program:hover .rod-past-thumbnail-img {
    filter: brightness(0.7) grayscale(0.1);
}

.rod-program-cell.rod-past-program .rod-program-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    color: white;
    z-index: 3;
}

.rod-past-thumbnail-content {
    position: relative;
    bottom: 0;
    z-index: 2;
    padding: 4px;
    width: 100%;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.7) 100%);
    color: white;
}

.rod-past-program-no-thumbnail {
    padding: 12px 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 3px solid #6c757d;
    height: 100%;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rod-past-program-no-thumbnail .rod-program-title {
    position: static;
    background: none;
    color: #495057;
    padding: 0;
    margin: 0 0 4px 0;
}

.rod-past-program .rod-program-hosts {
    margin-bottom: -5px;
}

.rod-past-program .rod-host-item {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 1px;
}

.rod-past-program .rod-host-avatar {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rod-past-program .rod-host-name {
    font-size: 9px;
    color: rgba(255,255,255,0.9);
    line-height: 1.1;
}

.rod-past-program-no-thumbnail .rod-host-name {
    color: #6c757d;
}

.rod-past-program .rod-date-badge {
    background: rgba(255,255,255,0.9);
    color: #495057;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 500;
    white-space: nowrap;
}

/* ==================== LIVE STREAMING CELL STYLES ==================== */

.rod-live-streaming-cell {
    position: relative;
    overflow: hidden;
    cursor: pointer !important;
    padding: 0 !important;
    min-height: 100px;
    border-left: 3px solid #dc3545 !important;
}

.rod-live-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.rod-live-background-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.rod-live-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.8) 0%, rgba(32, 201, 151, 0.8) 100%);
    z-index: 2;
}

.rod-live-content-overlay {
    position: relative;
    z-index: 3;
    padding: 12px 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
}

.rod-live-header {
    margin-bottom: 8px;
}

.rod-live-streaming-cell .rod-program-title {
    color: white;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

.rod-live-streaming-cell .rod-live-badge {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    animation: blink 1s infinite;
    flex-shrink: 0;
}

.rod-live-streaming-cell .rod-program-hosts {
    margin-bottom: 8px;
}

.rod-live-streaming-cell .rod-host-item {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.rod-live-streaming-cell .rod-host-avatar {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.3);
}

.rod-live-streaming-cell .rod-host-name {
    font-size: 10px;
    color: rgba(255,255,255,0.9);
    line-height: 1.2;
}

.rod-live-streaming-cell .rod-live-stream-link {
    margin: 8px 0;
    background: rgba(255,255,255,0.9);
    border-radius: 6px;
    padding: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    text-align: center;
}

.rod-live-streaming-cell .rod-stream-link-text {
    color: #dc3545;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    display: block;
}

.rod-live-streaming-cell .rod-program-time {
    font-size: 10px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: auto;
}

.rod-live-streaming-cell .rod-time-range {
    font-weight: 600;
    color: white;
}

.rod-live-streaming-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.rod-live-streaming-cell:hover .rod-live-background-image img {
    filter: brightness(0.8);
}

.rod-live-streaming-cell:hover .rod-live-overlay {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9) 0%, rgba(32, 201, 151, 0.9) 100%);
}

/* Live Streaming Pulse Animation */
.rod-live-pulse {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0% { transform: scale(0.8); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(0.8); opacity: 1; }
}

.rod-live-text {
    font-size: 8px;
    font-weight: 700;
}

/* ==================== LIVE STREAMING POPUP MODAL STYLES ==================== */

.rod-live-streaming-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.rod-live-streaming-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.rod-live-streaming-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 100000;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.rod-live-streaming-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.rod-live-streaming-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.rod-live-streaming-modal-body {
    padding: 10px 0;
    min-height: 200px;
}

.rod-player-loading {
    text-align: center;
    padding: 40px;
    color: white;
}

.rod-loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rod-player-error {
    text-align: center;
    padding: 40px;
    color: #ff4444;
}

.rod-player-error button {
    background: #ff4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
}

.rod-player-error button:hover {
    background: #ff6666;
}

/* ==================== MODAL STYLES ==================== */

.rod-program-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rod-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}

.rod-modal-content {
    position: relative;
    background: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    z-index: 10001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.rod-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.rod-modal-close:hover {
    background: #f8f9fa;
    color: #e74c3c;
}

.rod-modal-content h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 18px;
    padding-right: 30px;
}

.rod-modal-info {
    margin-bottom: 15px;
}

.rod-modal-info p {
    margin: 6px 0;
    color: #5d6d7e;
    font-size: 14px;
}

.rod-modal-description {
    margin: 15px 0;
    color: #5d6d7e;
    line-height: 1.5;
    font-size: 14px;
}

.rod-modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 8px;
}

.rod-modal-play,
.rod-modal-details,
.rod-modal-close-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 14px;
}

.rod-modal-play {
    background: #3498db;
    color: white;
    flex: 2;
}

.rod-modal-play:hover {
    background: #2980b9;
}

.rod-modal-details {
    background: #2ecc71;
    color: white;
    flex: 1;
}

.rod-modal-details:hover {
    background: #27ae60;
}

.rod-modal-close-btn {
    background: #95a5a6;
    color: white;
    flex: 1;
}

.rod-modal-close-btn:hover {
    background: #7f8c8d;
}

/* Status colors for modal */
.rod-current-status {
    color: #dc3545;
    font-weight: 600;
}

.rod-past-status {
    color: #6c757d;
}

.rod-future-status {
    color: #28a745;
}

/* ==================== MOBILE HORIZONTAL SCROLL STYLES ==================== */

@media (max-width: 992px) {
    .rod-timetable-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rod-timetable-header,
    .rod-timetable-body {
        min-width: 800px;
    }
    
    .rod-timetable-header {
        position: sticky;
        left: 0;
        z-index: 20;
    }
    
    .rod-time-column-header {
        position: sticky;
        left: 0;
        z-index: 15;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .rod-time-slot-header {
        position: sticky;
        left: 0;
        z-index: 10;
        background: #f8f9fa;
    }
}

/* Mobile Landscape Optimization */
@media (max-width: 992px) and (orientation: landscape) {
    .rod-timetable-body {
        max-height: 400px;
    }
    
    .rod-program-cell {
        min-height: 80px;
        padding: 6px 4px;
    }
    
    .rod-timetable-row {
        min-height: 80px;
    }
}

/* Mobile Portrait Optimization */
@media (max-width: 768px) and (orientation: portrait) {
    .rod-timetable-body {
        max-height: 500px;
    }
    
    .rod-timetable-header,
    .rod-timetable-body {
        min-width: 700px;
    }
}

/* Small Mobile Devices */
@media (max-width: 576px) {
    .rod-timetable-header,
    .rod-timetable-body {
        min-width: 600px;
    }
    
    .rod-program-cell {
        min-height: 70px;
        padding: 4px 2px;
    }
    
    .rod-timetable-row {
        min-height: 70px;
    }
    
    .rod-play-hover-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* Very Small Mobile Devices */
@media (max-width: 400px) {
    .rod-timetable-header,
    .rod-timetable-body {
        min-width: 550px;
    }
}

/* ==================== RESPONSIVE STYLES FOR LIVE STREAMING POPUP ==================== */

@media (max-width: 768px) {
    .rod-live-streaming-modal-content {
        width: 95%;
        padding: 15px;
    }
}

/* ==================== DEBUG STYLES ==================== */

.rod-debug-info {
    display: none;
}