/**
 * JOAN Styles
 * CodeSig: sgketg
 * Author: G & D Enterprises, Inc.
 */

/* Main widget container */
.joan-now-playing {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

/* Show information container */
.joan-show-info {
    margin-bottom: 15px;
}

/* Current show title */
.current-show {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.current-show a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.current-show a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Jock/DJ name */
.joan-jock {
    font-style: italic;
    color: #666;
    margin-bottom: 5px;
    font-size: 0.95em;
}

/* Show time display */
.show-time {
    color: #555;
    font-weight: 600;
    font-size: 0.9em;
    font-family: "Courier New", monospace;
}

/* FIXED: Image positioning - all images now under show info */
.joan-image-standard,
.joan-image-large {
    margin: 15px 0 0 0;
    text-align: center;
}

/* Standard image styling */
.joan-thumb {
    max-width: 250px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
}

.joan-thumb:hover {
    transform: scale(1.02);
}

/* Large image styling */
.joan-thumb-large {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}

/* REMOVED: Right-aligned image styles (no longer used) */
/* This fixes the issue where small images were being positioned to the right */

/* Upcoming show section */
.upcoming-show {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 0.9em;
    color: #666;
}

.upcoming-show strong {
    color: #333;
}

.upcoming-time {
    display: block;
    font-family: "Courier New", monospace;
    font-size: 0.85em;
    color: #777;
    margin-top: 3px;
}

/* Current time display */
.joan-current-time {
    text-align: center;
    font-size: 0.85em;
    color: #777;
    margin-bottom: 10px;
    font-family: "Courier New", monospace;
}

/* Timezone selector */
.joan-timezone-selector {
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.9em;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.joan-timezone-selector label {
    color: #666;
    margin-right: 8px;
    font-weight: 500;
}

.joan-timezone-selector select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    background: white;
}

/* Enhanced timezone selector with time display */
.joan-timezone-selector .joan-timezone-time {
    margin-top: 8px;
    font-size: 0.85em;
    color: #555;
    font-family: "Courier New", monospace;
    font-weight: 600;
}

/* Center title option */
.joan-center-title {
    text-align: center;
}

/* Jock-only mode */
.joan-jock-only-mode .current-show,
.joan-jock-only-mode .joan-jock {
    display: none;
}

.joan-jock-only-mode .show-time {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 10px;
}

/* Status messages */
.joan-status-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.joan-status-icon {
    font-size: 1.5em;
    margin-right: 8px;
}

/* Status-specific styling */
.joan-status-suspended {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.joan-status-off_air {
    background: #f8d7da;
    border-color: #f5c6cb;
}

/* Loading and error states */
.joan-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

.joan-error {
    text-align: center;
    padding: 20px;
    color: #d63638;
    background: #ffeaea;
    border: 1px solid #f0c2c2;
    border-radius: 4px;
}

.joan-error a {
    color: #d63638;
    font-weight: bold;
}

/* Hide elements based on settings */
.joan-hide-images .joan-thumb,
.joan-hide-images .joan-image-standard,
.joan-hide-images .joan-image-large {
    display: none;
}

.joan-hide-upcoming .upcoming-show {
    display: none;
}

/* ========================================================================
   DAY-SEPARATED SCHEDULE STYLES (Enhanced Frontend)
   ======================================================================== */

/* Schedule container */
.joan-schedule-container {
    margin: 20px 0;
}

/* Day section headers */
.joan-schedule-day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    margin: 25px 0 0 0;
    border-radius: 8px 8px 0 0;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* First day header (no top margin) */
.joan-schedule-day-header:first-child {
    margin-top: 0;
}

/* Individual day schedule tables */
.joan-schedule-day-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    margin-bottom: 5px;
}

/* Day-specific header colors */
.joan-sunday-header {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.joan-monday-header {
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc8 100%);
}

.joan-tuesday-header {
    background: linear-gradient(135deg, #ffd3a5 0%, #ffeebc 100%);
}

.joan-wednesday-header {
    background: linear-gradient(135deg, #a8c8ec 0%, #c3d5f5 100%);
}

.joan-thursday-header {
    background: linear-gradient(135deg, #c8a2c8 0%, #e1bee7 100%);
}

.joan-friday-header {
    background: linear-gradient(135deg, #ffb3ba 0%, #ffcccc 100%);
}

.joan-saturday-header {
    background: linear-gradient(135deg, #bae1ff 0%, #d4f1ff 100%);
}

/* Day-specific table header colors */
.joan-sunday-table th {
    background-color: #ff6b87;
    color: white;
}

.joan-monday-table th {
    background-color: #4caf50;
    color: white;
}

.joan-tuesday-table th {
    background-color: #ff9800;
    color: white;
}

.joan-wednesday-table th {
    background-color: #2196f3;
    color: white;
}

.joan-thursday-table th {
    background-color: #9c27b0;
    color: white;
}

.joan-friday-table th {
    background-color: #f44336;
    color: white;
}

.joan-saturday-table th {
    background-color: #00bcd4;
    color: white;
}

/* Standard schedule table styles (for unseparated and filtered tables) */
table.joan-schedule {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}

table.joan-schedule th {
    background: #0073aa;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table.joan-schedule td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

table.joan-schedule tr:hover {
    background: #f8f9fa;
}

table.joan-schedule tr:nth-child(even) {
    background: #fafafa;
}

table.joan-schedule tr:nth-child(even):hover {
    background: #f0f0f0;
}

/* Ensure filtered schedules maintain clean appearance */
table.joan-schedule.joan-filtered-schedule,
.joan-filtered-schedule table.joan-schedule {
    border-radius: 6px;
}

.joan-filtered-schedule table.joan-schedule th {
    background: #28a745; /* Green for "What's on today" */
}

/* Day table specific styling */
.joan-schedule-day-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: none;
}

.joan-schedule-day-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    border-left: none;
    border-right: none;
}

.joan-schedule-day-table tr:hover {
    background: rgba(0,0,0,0.02);
}

.joan-schedule-day-table tr:nth-child(even) {
    background: rgba(0,0,0,0.01);
}

.joan-schedule-day-table tr:nth-child(even):hover {
    background: rgba(0,0,0,0.03);
}

/* Empty day message */
.joan-schedule-empty-day {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 0 0 8px 8px;
}

/* Today's schedule highlighting */
.joan-today-highlight {
    background: #e7f3ff !important;
    border-left: 4px solid #0073aa;
}

.joan-current-show-highlight {
    background: #d1ecf1 !important;
    border-left: 4px solid #17a2b8;
    font-weight: bold;
}

/* Schedule filter controls */
.joan-schedule-controls {
    margin: 20px 0 15px 0;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.joan-schedule-controls label {
    font-weight: 600;
    margin-right: 10px;
    color: #495057;
}

.joan-schedule-controls select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    color: #495057;
    font-size: 14px;
    min-width: 150px;
}

/* Upcoming shows list */
.joan-upcoming-shows {
    margin: 20px 0;
}

.joan-upcoming-item {
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid #0073aa;
}

/* Responsive design */
@media (max-width: 768px) {
    .joan-now-playing {
        padding: 12px;
        font-size: 14px;
    }
    
    .current-show {
        font-size: 1.2em;
    }
    
    .joan-thumb,
    .joan-thumb-large {
        max-width: 200px;
    }
    
    /* Day-separated schedule responsive */
    .joan-schedule-day-header {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .joan-schedule-day-table,
    table.joan-schedule {
        font-size: 14px;
    }
    
    .joan-schedule-day-table th,
    .joan-schedule-day-table td,
    table.joan-schedule th,
    table.joan-schedule td {
        padding: 8px;
    }
    
    .joan-timezone-selector {
        font-size: 0.8em;
    }
    
    .joan-timezone-selector select {
        width: 100%;
        max-width: 200px;
    }
    
    .joan-timezone-selector {
        padding: 8px;
        margin: 10px 0;
    }
    
    .joan-timezone-selector .joan-timezone-time {
        font-size: 0.8em;
        margin-top: 6px;
    }
    
    .joan-schedule-controls {
        padding: 10px;
    }
    
    .joan-schedule-controls select {
        width: 100%;
        max-width: 200px;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .joan-now-playing {
        padding: 10px;
        margin: 5px 0;
    }
    
    .joan-thumb,
    .joan-thumb-large {
        max-width: 150px;
    }
    
    .joan-schedule-day-header {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .joan-schedule-day-table,
    table.joan-schedule {
        font-size: 12px;
    }
    
    /* Hide less important columns on very small screens */
    .joan-schedule-day-table th:nth-child(n+4),
    .joan-schedule-day-table td:nth-child(n+4),
    table.joan-schedule th:nth-child(n+4),
    table.joan-schedule td:nth-child(n+4) {
        display: none;
    }
    
    .joan-schedule-empty-day {
        padding: 20px 15px;
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .joan-now-playing {
        box-shadow: none;
        border: 2px solid #000;
    }
    
    .joan-timezone-selector,
    .joan-schedule-controls {
        display: none;
    }
    
    .current-show a {
        color: #000 !important;
        text-decoration: none;
    }
    
    .current-show a:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
    
    .joan-schedule-day-header {
        background: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .joan-now-playing {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .current-show {
        color: #ecf0f1;
    }
    
    .current-show a {
        color: #3498db;
    }
    
    .current-show a:hover {
        color: #2980b9;
    }
    
    .joan-jock,
    .upcoming-show {
        color: #bdc3c7;
    }
    
    .show-time {
        color: #95a5a6;
    }
    
    .upcoming-show {
        border-top-color: #34495e;
    }
    
    .joan-timezone-selector select {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5c6a;
    }
    
    .joan-timezone-selector {
        background: #34495e;
        border-color: #4a5c6a;
        color: #ecf0f1;
    }
    
    .joan-timezone-selector .joan-timezone-time {
        color: #bdc3c7;
    }
    
    .joan-schedule-day-table,
    table.joan-schedule {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .joan-schedule-day-table th,
    table.joan-schedule th {
        background: #34495e;
    }
    
    .joan-schedule-day-table td,
    table.joan-schedule td {
        border-bottom-color: #4a5c6a;
    }
    
    .joan-schedule-day-table tr:hover,
    table.joan-schedule tr:hover {
        background: #34495e;
    }
    
    .joan-schedule-day-table tr:nth-child(even),
    table.joan-schedule tr:nth-child(even) {
        background: #2c3e50;
    }
    
    .joan-schedule-empty-day {
        background: #34495e;
        border-color: #4a5c6a;
        color: #bdc3c7;
    }
    
    .joan-schedule-controls {
        background: #34495e;
        border-color: #4a5c6a;
        color: #ecf0f1;
    }
    
    .joan-schedule-controls select {
        background: #2c3e50;
        border-color: #4a5c6a;
        color: #ecf0f1;
    }
}

/* Accessibility improvements */
.joan-now-playing:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.current-show a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
    border-radius: 2px;
}

.joan-schedule-controls select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .joan-thumb,
    .current-show a {
        transition: none;
    }
    
    .joan-thumb:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .joan-now-playing {
        border-width: 2px;
        border-color: #000;
    }
    
    .current-show a {
        text-decoration: underline;
    }
    
    .joan-thumb {
        border: 2px solid #000;
    }
    
    .joan-schedule-day-header {
        border: 2px solid #000;
    }
    
    .joan-schedule-day-table,
    table.joan-schedule {
        border: 2px solid #000;
    }
}