/* ── Toolbar ── */
.prayer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.prayer-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.prayer-controls input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-weight: normal;
}

.prayer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.15s;
}

.prayer-btn:hover  { background: #f0f0f0; }
.prayer-btn:active { background: #e4e4e4; }

.prayer-btn.primary {
    background: #B38934;
    color: #fff;
    border-color: #B38934;
}

.prayer-btn.primary:hover  { background: #9a7528; border-color: #9a7528; }
.prayer-btn.primary:active { background: #86641e; }

/* ── Inline error message ── */
.prayer-error {
    display: none;
    color: #900;
    font-size: 0.88rem;
    padding: 7px 12px;
    background: #fff4f4;
    border-left: 3px solid #c00;
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}

.prayer-error.visible { display: block; }

/* ── Table card ── */
.prayer-table-wrapper {
    background: #fff;
    border-radius: 14px;
    border-top: 5px solid #B38934;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
    overflow: hidden;
}

.prayer-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Table ── */
.prayer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.prayer-table thead tr {
    background: #f0f4f8;
}

.prayer-table th {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #eee;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

.prayer-table th:first-child { padding-left: 14px; }
.prayer-table th:last-child  { border-right: none; }

/* ── Grouped two-row header ── */
.th-date {
    vertical-align: middle;
    border-bottom: 2px solid #e8d9b5 !important;
}

.th-prayer-group {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: #111;
    padding-bottom: 5px;
}

/* Shurooq spans both rows — vertically center it */
.th-single {
    vertical-align: middle;
    border-bottom: 2px solid #e8d9b5 !important;
}

/* Sub-row: Start / Iqamah */
.th-sub {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #666;
    padding-top: 4px;
    padding-bottom: 7px;
    border-bottom: 2px solid #e8d9b5;
    background: #f7f7f7;
}

.th-iqamah-sub {
    color: #8a6520;
    border-right: 1px solid #e8d9b5;
}

.prayer-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f1f1;
    border-right: 1px solid #f5f5f5;
    vertical-align: middle;
    font-size: 13px;
    color: #333;
}

.prayer-table td:first-child { padding-left: 14px; font-weight: 600; }
.prayer-table td:last-child  { border-right: none; }

/* alternating rows */
.prayer-table tbody tr:nth-child(even) td { background: #fafafa; }

/* hover */
.prayer-table tbody tr:hover td { background: #fffdf6 !important; }

/* today highlight */
.prayer-table tbody tr.today-row td { background: #fff8ed !important; }
.prayer-table tbody tr.today-row td:first-child {
    color: #8a6520;
    border-left: 3px solid #B38934;
}

/* iqamah — most important time, shown prominently */
.prayer-table td.iqamah-cell {
    color: #8a6520;
    font-weight: 700;
}

/* loading / empty / error state */
.prayer-table tbody tr.state-row td {
    text-align: center;
    color: #888;
    padding: 28px;
    font-size: 14px;
}

/* ── Jumu'ah expansion row (Fridays) ── */
.prayer-table tbody tr.jumuah-row td {
    background: rgba(179, 137, 52, 0.07) !important;
    border-bottom: 2px solid rgba(179, 137, 52, 0.25) !important;
    border-right: none;
    padding: 5px 14px 7px;
}

.jumuah-row-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

.jumuah-row-content .fa-mosque { color: #B38934; font-size: 13px; }

.jumuah-label {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #8a6520;
    margin-right: 2px;
}

.jumuah-slot {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.jumuah-slot-top {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.jumuah-slot-num {
    font-size: 10px;
    color: #8a6520;
    font-weight: 600;
}

.jumuah-slot-time {
    font-weight: 700;
    color: #B38934;
}

.jumuah-slot-khatib-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.jumuah-slot-khatib-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a6520;
}

.jumuah-slot-khatib-name {
    font-size: 11px;
    color: #555;
}

.jumuah-sep { color: #ccc; font-size: 10px; align-self: flex-start; margin-top: 3px; }

/* ── Mobile card layout ── */
@media (max-width: 767px) {
    .prayer-table thead { display: none; }

    .prayer-table,
    .prayer-table tbody,
    .prayer-table tr,
    .prayer-table td { display: block !important; width: 100% !important; }

    .prayer-table-scroll { overflow-x: visible; }

    .prayer-table tr {
        border: 1px solid #ddd;
        border-radius: 10px;
        margin: 10px 12px;
        width: calc(100% - 24px) !important;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.07);
        padding: 4px 0;
    }

    .prayer-table tbody tr.today-row {
        border-color: #B38934;
        border-left-width: 3px;
    }

    .prayer-table td {
        display: flex !important;
        align-items: center;
        padding: 7px 14px;
        border: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        font-size: 14px;
        gap: 8px;
    }

    .prayer-table td:last-child { border-bottom: none !important; }

    .prayer-table td:first-child {
        font-size: 15px;
        font-weight: 700;
        color: #0a4a2f;
        border-bottom: 2px solid #f0e8d5 !important;
        padding-bottom: 10px;
    }

    .prayer-table td:first-child::before { display: none; }

    .prayer-table td::before {
        content: attr(data-label);
        flex: 0 0 95px;
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #888;
    }

    .prayer-table td.iqamah-cell::before { color: #B38934; }

    /* Jumu'ah row on mobile — flush strip beneath the Friday card */
    .prayer-table tbody tr.has-jumuah {
        border-radius: 10px 10px 0 0;
        border-bottom: none !important;
        margin-bottom: 0 !important;
    }

    .prayer-table tbody tr.jumuah-row {
        border: 1px solid rgba(179, 137, 52, 0.35) !important;
        border-top: none !important;
        border-radius: 0 0 10px 10px;
        background: rgba(179, 137, 52, 0.07) !important;
        box-shadow: none;
        margin: 0 12px 10px !important;
        padding: 6px 0 !important;
    }

    .prayer-table tbody tr.jumuah-row td {
        padding: 6px 14px !important;
        border: none !important;
    }

    .prayer-table tbody tr.jumuah-row td::before { display: none; }

    /* toolbar stacks on mobile */
    .prayer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .prayer-controls label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .prayer-controls input[type="date"] {
        width: 100%;
        font-size: 16px;
        padding: 9px 10px;
        min-height: 42px;
    }

    .prayer-btn {
        min-height: 42px;
        font-size: 15px;
        justify-content: center;
    }
}
