/*
 * The pages of the Tools section (App\Filament\Pages\Tools): the Quran, the adhkar, the prayer times and the weather.
 *
 * The panel has no compiled Tailwind theme, so the pages are styled here with Filament's
 * color variables. Edit this file, then run `php artisan filament:assets` to publish it.
 */

@import url('https://fonts.googleapis.com/css2?family=Amiri+Quran&display=swap');

.tl-shell {
    --tl-surface: #fff;
    --tl-border: var(--gray-200);
    --tl-text: var(--gray-950);
    --tl-text-muted: var(--gray-500);
    --tl-hover: var(--gray-50);
    --tl-accent: var(--primary-600);
    --tl-accent-soft: color-mix(in oklab, var(--primary-500) 10%, transparent);
    --tl-done: var(--success-600);
    --tl-done-soft: color-mix(in oklab, var(--success-500) 10%, transparent);

    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--tl-text);
}

.dark .tl-shell {
    --tl-surface: var(--gray-900);
    --tl-border: color-mix(in oklab, #fff 10%, transparent);
    --tl-text: #fff;
    --tl-text-muted: var(--gray-400);
    --tl-hover: color-mix(in oklab, #fff 5%, transparent);
    --tl-accent: var(--primary-400);
    --tl-done: var(--success-400);
}

.tl-shell [x-cloak] {
    display: none !important;
}

.tl-card {
    border: 1px solid var(--tl-border);
    border-radius: 0.875rem;
    background: var(--tl-surface);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.tl-muted {
    color: var(--tl-text-muted);
}

.tl-small {
    font-size: 0.8125rem;
}

.tl-pad {
    padding: 1rem;
}

.tl-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.tl-link {
    color: var(--tl-accent);
    text-decoration: underline;
}

.tl-badge {
    flex-shrink: 0;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    background: var(--tl-accent-soft);
    color: var(--tl-accent);
    font-size: 0.75rem;
    white-space: nowrap;
}

.tl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tl-toolbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tl-layout-switch {
    display: flex;
    gap: 0.25rem;
}

.tl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    text-align: center;
}

.tl-empty-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--tl-text-muted);
}

/* Quran */

.tl-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--tl-border);
    border-radius: 0.75rem;
    background: var(--tl-surface);
}

.tl-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    outline: none;
    box-shadow: none;
}

.tl-bookmark {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    color: var(--tl-accent);
    font-weight: 600;
}

.tl-bookmark:hover,
.tl-surah:hover,
.tl-result:hover {
    background: var(--tl-hover);
}

.tl-surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.75rem;
}

.tl-surah {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-align: start;
    cursor: pointer;
}

.tl-surah-number {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: var(--tl-accent-soft);
    color: var(--tl-accent);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tl-surah-name {
    font-weight: 600;
}

.tl-result {
    display: flex;
    width: 100%;
    text-align: start;
    cursor: pointer;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--tl-border);
}

.tl-result:last-child {
    border-bottom: 0;
}

.tl-result-text {
    font-family: 'Amiri Quran', serif;
    font-size: 1.25rem;
    line-height: 2.2;
}

.tl-reader {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/*
 * Full screen reading: the browser's Fullscreen API shows the reader alone, and the fixed position also covers
 * the panel where the API is not available (Safari on the iPhone).
 */
.tl-reader.is-fullscreen {
    --tl-page-bg: var(--gray-50);

    position: fixed;
    inset: 0;
    z-index: 50;
    gap: 0.5rem;
    padding: 0.75rem;
    overflow-y: auto;
    background: var(--tl-page-bg);
}

.dark .tl-reader.is-fullscreen {
    --tl-page-bg: var(--gray-950);
}

/* Fit the whole page in the height of the screen, keeping the 456 × 672 ratio of the page images. */
.tl-reader.is-fullscreen .tl-mushaf-page {
    max-width: max(16rem, calc((100dvh - 10.5rem) * 456 / 672));
}

.tl-reader.is-fullscreen .tl-hint {
    display: none;
}

.tl-page-details {
    font-weight: 600;
    text-align: center;
}

/* One page, or the odd page on the right and the even page on the left like an open mushaf. */
.tl-mushaf-spread {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.tl-mushaf-spread.is-two-pages .tl-mushaf-page {
    flex: 1 1 0;
    min-width: 0;
}

.tl-mushaf-spread.is-two-pages .tl-mushaf-page:first-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.tl-mushaf-spread.is-two-pages .tl-mushaf-page:last-child {
    border-left-width: 1px;
    border-right-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* The page images have a transparent background and black text, so they keep a light page even in dark mode. */
.tl-mushaf-page {
    align-self: center;
    width: 100%;
    max-width: 34rem;
    padding: 0.5rem;
    border: 1px solid var(--tl-border);
    border-radius: 0.875rem;
    background: #fffdf6;
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.08);
    touch-action: pan-y;
}

.tl-mushaf-page img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.tl-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tl-page-jump {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.tl-page-jump input {
    width: 4.5rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--tl-border);
    border-radius: 0.5rem;
    background: var(--tl-surface);
    color: inherit;
    text-align: center;
}

.tl-hint {
    font-size: 0.8125rem;
    text-align: center;
}

/* Adhkar */

.tl-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.tl-tab {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border: 1px solid var(--tl-border);
    border-radius: 999px;
    background: var(--tl-surface);
    font-size: 0.875rem;
    cursor: pointer;
}

.tl-tab.is-active {
    border-color: var(--tl-accent);
    background: var(--tl-accent);
    color: #fff;
}

.tl-dhikr-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tl-dhikr {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.125rem 1.25rem;
    text-align: start;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    user-select: none;
}

.tl-dhikr:active {
    transform: scale(0.995);
}

.tl-dhikr.is-done {
    border-color: var(--tl-done);
    background: var(--tl-done-soft);
    opacity: 0.75;
}

.tl-dhikr-text {
    font-size: 1.1875rem;
    line-height: 2.1;
}

.tl-dhikr-virtue {
    padding-inline-start: 0.75rem;
    border-inline-start: 3px solid var(--tl-border);
    color: var(--tl-text-muted);
    font-size: 0.875rem;
}

.tl-dhikr-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tl-counter {
    min-width: 4.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--tl-accent-soft);
    color: var(--tl-accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.tl-dhikr.is-done .tl-counter {
    background: var(--tl-done);
    color: #fff;
}

/* Prayer times and weather */

.tl-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--tl-accent-soft), transparent 70%), var(--tl-surface);
}

.tl-hero-label {
    color: var(--tl-text-muted);
    font-size: 0.875rem;
}

.tl-hero-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.tl-countdown {
    color: var(--tl-accent);
    font-size: 2.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tl-prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.75rem;
}

.tl-prayer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
}

.tl-prayer.is-muted {
    opacity: 0.7;
}

.tl-prayer.is-next {
    border-color: var(--tl-accent);
    background: var(--tl-accent-soft);
}

.tl-prayer-name {
    color: var(--tl-text-muted);
}

.tl-prayer-time {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tl-weather-now {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tl-weather-emoji {
    font-size: 3.5rem;
    line-height: 1;
}

.tl-weather-temp {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.tl-weather-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.tl-weather-stats dd {
    font-size: 1.125rem;
    font-weight: 600;
}

.tl-forecast-row {
    display: grid;
    grid-template-columns: 6rem 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--tl-border);
}

.tl-forecast-row:last-child {
    border-bottom: 0;
}

.tl-forecast-day {
    font-weight: 600;
}

.tl-forecast-temp {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

@media (max-width: 480px) {
    .tl-forecast-row {
        grid-template-columns: 4.5rem 1fr auto;
    }

    .tl-forecast-row .tl-small {
        display: none;
    }
}

/* The map of the picked location in the location fields (App\Filament\Forms\LocationFields) */

.tl-map {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tl-map iframe {
    width: 100%;
    height: 16rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
}

.dark .tl-map iframe {
    border-color: color-mix(in oklab, #fff 10%, transparent);
}

.tl-map-link {
    align-self: flex-start;
    color: var(--primary-600);
    font-size: 0.8125rem;
    text-decoration: underline;
}

.tl-map-empty {
    display: grid;
    place-items: center;
    min-height: 8rem;
    padding: 1rem;
    border: 1px dashed var(--gray-300);
    border-radius: 0.75rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    text-align: center;
}
