/* Prayer Times Widget Styles */
/* Color Palette:
   - Primary (Pine Teal): #00685E
   - Secondary (Soft Seafoam): #A3D9CF
   - Action (Deep Ochre): #C28B2E
   - Background (Alabaster White): #F8F9F8
   - Text (Charcoal Grey): #2D3436
*/

.prayer-times-widget {
    --pt-primary: #00685e;
    --pt-primary-dark: #005950;
    --pt-primary-darker: #004a43;
    --pt-primary-soft: #edf6f3;
    --pt-primary-soft-alt: #e7f3ef;
    --pt-primary-soft-strong: #dbeee8;
    --pt-primary-rgb: 0, 104, 94;
    --pt-on-primary: #ffffff;
    max-width: 600px;
    margin: 24px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfa 100%);
    border: 1px solid rgba(var(--pt-primary-rgb), 0.12);
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.10), 0 4px 14px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Date Header */
.prayer-times-header {
    padding: 22px 24px 18px;
    background-color: var(--pt-primary);
    color: var(--pt-on-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prayer-times-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.prayer-times-header-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.current-date {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    color: var(--pt-on-primary);
    width: 100%;
}

/* Navigation below widget */
.prayer-times-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 20px 20px;
    background: #ffffff;
    color: #2D3436;
}

.prayer-times-note {
    padding: 16px 20px;
    background: linear-gradient(180deg, var(--pt-primary-soft) 0%, var(--pt-primary-soft-alt) 100%);
    color: #2D3436;
    font-size: 14px;
    line-height: 1.5;
    border-top: 1px solid rgba(var(--pt-primary-rgb), 0.10);
    text-align: center;
}

/* Monthly timetable uses the full content width */
.prayer-times-monthly-widget {
    max-width: none;
    width: auto;
    box-sizing: border-box;
    margin: 24px 20px;
}

.prayer-times-monthly-header {
    padding-bottom: 16px;
}

.prayer-times-month-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.prayer-times-month-select-wrap {
    display: none;
    margin-top: 14px;
}

.prayer-times-month-select {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.16);
    color: var(--pt-on-primary);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1.4 0.6L6 5.2 10.6 0.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 36px;
    cursor: pointer;
}

.prayer-times-month-select option {
    color: #2D3436;
    background: #ffffff;
}

.prayer-times-month-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: var(--pt-on-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.prayer-times-month-link:hover,
.prayer-times-month-link:focus {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.prayer-times-month-link.is-active {
    background: #ffffff;
    color: var(--pt-primary-darker);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.10);
}

.prayer-times-monthly-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
}

.prayer-times-monthly-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.prayer-times-monthly-table th,
.prayer-times-monthly-table td {
    white-space: nowrap;
}

.prayer-times-monthly-table th:first-child,
.prayer-times-monthly-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #ffffff;
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.04);
}

.prayer-times-monthly-table thead th:first-child {
    z-index: 2;
    background: #f6f8f7;
}

.prayer-times-monthly-table tbody tr:nth-child(even) td:first-child {
    background: #fbfcfc;
}

.prayer-times-monthly-table tbody tr:hover td:first-child {
    background: var(--pt-primary-soft);
}

.prayer-times-monthly-date-cell {
    min-width: 72px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfc 100%);
}

.prayer-times-monthly-date-label {
    font-weight: 700;
}

.prayer-times-monthly-time-cell {
    vertical-align: top;
}

.prayer-times-monthly-cell-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.35;
}

.prayer-times-monthly-cell-line + .prayer-times-monthly-cell-line {
    margin-top: 4px;
}

.prayer-times-monthly-cell-line-single {
    justify-content: center;
}

.prayer-times-monthly-cell-meta {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7473;
}

.prayer-times-monthly-cell-value {
    font-size: 13px;
    font-weight: 700;
    color: #2D3436;
}

.prayer-times-monthly-empty,
.prayer-times-monthly-empty-row {
    color: #7b8483;
}

.prayer-times-monthly-empty-row {
    text-align: center;
    padding: 20px;
}

.prayer-times-monthly-current-day {
    background: linear-gradient(90deg, rgba(var(--pt-primary-rgb), 0.10) 0%, rgba(var(--pt-primary-rgb), 0.04) 100%) !important;
}

.prayer-times-monthly-current-day td:first-child,
.prayer-times-monthly-current-day .prayer-times-monthly-date-cell {
    background: linear-gradient(90deg, rgba(var(--pt-primary-rgb), 0.14) 0%, rgba(var(--pt-primary-rgb), 0.08) 100%) !important;
}

.prayer-times-monthly-current-day .prayer-times-monthly-date-label {
    color: var(--pt-primary-darker);
}

.prayer-times-widget .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Navigation Buttons */
.prev-day,
.next-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.12);
    color: var(--pt-on-primary);
    border: 1px solid rgba(255, 255, 255, 0.20);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.prev-day:hover:not([disabled]),
.next-day:hover:not([disabled]) {
    background-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.16);
}

.prev-day:disabled,
.next-day:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.today-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    color: var(--pt-on-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.today-day:hover,
.today-day:focus {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.today-day[hidden] {
    display: none !important;
}

.prayer-times-monthly-link-wrap {
    padding: 14px 20px 18px;
    text-align: center;
    background: #ffffff;
    border-top: 1px solid rgba(var(--pt-primary-rgb), 0.10);
}

.prayer-times-monthly-link {
    color: var(--pt-primary-darker);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.prayer-times-monthly-link:hover,
.prayer-times-monthly-link:focus {
    text-decoration: underline;
}

/* Prayer Times Table */
.prayer-times-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
}

.prayer-times-table thead {
    background-color: #f6f8f7;
    color: #6b7473;
}

.prayer-times-table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 1px solid rgba(var(--pt-primary-rgb), 0.10);
}

.prayer-times-table th:first-child {
    text-align: left;
}

.prayer-times-table th:not(:first-child) {
    text-align: center;
}

.prayer-times-table tbody tr {
    border-bottom: 1px solid rgba(var(--pt-primary-rgb), 0.08);
    transition: background-color 0.2s ease;
}

.prayer-times-table tbody tr:nth-child(even) {
    background-color: #fbfcfc;
}

.prayer-times-table tbody tr:hover {
    background-color: var(--pt-primary-soft);
}

.prayer-times-table tbody tr.prayer-times-upcoming-row {
    background: linear-gradient(90deg, var(--pt-primary) 0%, var(--pt-primary-dark) 100%);
    box-shadow: inset 5px 0 0 var(--pt-primary-darker);
}

.prayer-times-table tbody tr.prayer-times-upcoming-row:hover {
    background: linear-gradient(90deg, var(--pt-primary-dark) 0%, var(--pt-primary-darker) 100%);
}

.prayer-times-table td {
    padding: 18px;
    color: #2D3436;
    font-size: 15px;
}

.prayer-name {
    font-weight: 600;
    text-align: left;
}

.prayer-time {
    text-align: center;
    font-weight: 700;
}

.prayer-times-upcoming-row .prayer-name,
.prayer-times-upcoming-row .prayer-time {
    color: var(--pt-on-primary);
}

.prayer-times-upcoming-row .prayer-name {
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Jumah Row Highlight */
.jumah-row {
    background-color: var(--pt-primary-soft-strong) !important;
    font-weight: 600;
}

.jumah-row .prayer-name {
    color: var(--pt-primary-darker);
    font-size: 14px;
}

.jumah-row .prayer-time {
    color: #2D3436;
}

/* Loading State */
.prayer-times-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Mobile Responsive Design */
@media screen and (max-width: 768px) {
    .prayer-times-monthly-widget {
        margin: 16px 12px;
    }

    .prayer-times-month-links {
        display: none;
    }

    .prayer-times-month-select-wrap {
        display: block;
    }

    .prayer-times-monthly-table-wrap {
        margin: 0;
    }

    /* Keep every prayer column reachable via horizontal scroll */
    .prayer-times-monthly-table {
        width: max-content;
        min-width: 100%;
    }

    .prayer-times-monthly-table th,
    .prayer-times-monthly-table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .prayer-times-monthly-table th {
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .prayer-times-monthly-date-cell {
        min-width: 64px;
    }

    .prayer-times-monthly-cell-meta {
        font-size: 10px;
    }

    .prayer-times-monthly-cell-value {
        font-size: 12px;
    }
}

@media screen and (max-width: 600px) {
    .prayer-times-widget:not(.prayer-times-monthly-widget) {
        margin: 12px;
        border-radius: 16px;
    }

    .prayer-times-monthly-widget {
        margin: 12px 10px;
        border-radius: 16px;
    }
    
    .prayer-times-header {
        padding: 18px 16px 15px;
    }

    .prayer-times-header-row {
        gap: 8px;
    }
    
    .current-date {
        font-size: 14px;
    }
    
    .prayer-times-nav {
        padding: 16px 14px 18px;
        gap: 10px;
    }

    .prayer-times-note {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .prev-day,
    .next-day {
        width: 34px;
        height: 34px;
        font-size: 20px;
    }

    .today-day {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .prayer-times-table th,
    .prayer-times-table td {
        padding: 13px 10px;
        font-size: 14px;
    }
    
    .prayer-times-table th {
        font-size: 12px;
    }

    .prayer-times-monthly-table th,
    .prayer-times-monthly-table td {
        padding: 11px 8px;
    }
}

@media screen and (max-width: 400px) {
    .prayer-times-table:not(.prayer-times-monthly-table) th,
    .prayer-times-table:not(.prayer-times-monthly-table) td {
        padding: 11px 7px;
        font-size: 13px;
    }
    
    .prev-day,
    .next-day {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .prayer-times-month-select {
        max-width: none;
        font-size: 14px;
    }
}

@media screen and (min-width: 769px) {
    .prayer-times-monthly-widget {
        margin: 28px 24px 24px;
    }

    .prayer-times-monthly-table th,
    .prayer-times-monthly-table td {
        padding: 16px 14px;
    }

    .prayer-times-monthly-cell-value {
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .prayer-times-header {
        background-color: white !important;
        color: #2D3436 !important;
        border-bottom: 2px solid var(--pt-primary);
    }
    
    .prayer-times-nav {
        display: none;
    }
    
    .prev-day,
    .next-day,
    .today-day,
    .prayer-times-monthly-link-wrap {
        display: none;
    }

    .prayer-times-month-links,
    .prayer-times-month-select-wrap {
        display: none;
    }
    
    .current-date {
        color: #2D3436 !important;
    }

    .prayer-times-monthly-widget {
        margin: 0;
        max-width: none;
        box-shadow: none;
        border: none;
    }

    .prayer-times-monthly-table {
        width: 100%;
        min-width: 0;
    }
}
