/**
 * Turkpidya Prayer Times - Refined Sacred Theme v3
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap");

:root {
    --tpt-bg: #FDF6E9;
    --tpt-bg-card: #FFFFFF;
    --tpt-primary: #B8860B;
    --tpt-accent: #C41E3A;
    --tpt-text: #2D2A26;
    --tpt-text-secondary: #5C5650;
    --tpt-text-muted: #8B8580;
    
    --fajr-bg: linear-gradient(135deg, #E8EAF6 0%, #C5CAE9 100%);
    --fajr-border: #5C6BC0;
    --sunrise-bg: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    --sunrise-border: #FFB300;
    --dhuhr-bg: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    --dhuhr-border: #1E88E5;
    --asr-bg: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    --asr-border: #FB8C00;
    --maghrib-bg: linear-gradient(135deg, #FCE4EC 0%, #F8BBD9 100%);
    --maghrib-border: #E91E63;
    --isha-bg: linear-gradient(135deg, #EDE7F6 0%, #D1C4E9 100%);
    --isha-border: #7E57C2;
    
    --tpt-font-display: 'Outfit', sans-serif;
    --tpt-font-body: 'Inter', sans-serif;
    --tpt-radius: 16px;
    --tpt-radius-sm: 8px;
    --tpt-radius-full: 9999px;
}

.tpt-container {
    font-family: var(--tpt-font-body);
    color: var(--tpt-text);
    position: relative;
    width: 100%;
    background: var(--tpt-bg);
    border-radius: var(--tpt-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 1.5rem 0;
}

.tpt-container * { box-sizing: border-box; margin: 0; padding: 0; }
.tpt-sky, .tpt-stars, .tpt-celestial { display: none !important; }

.tpt-content {
    position: relative;
    z-index: 10;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* HEADER */
.tpt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tpt-header__info h1 {
    font-family: var(--tpt-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tpt-text);
}

.tpt-header__subtitle {
    font-size: 0.875rem;
    color: var(--tpt-text-secondary);
    margin-top: 4px;
}

/* CITY PICKER - FIXED hover */
.tpt-city-picker { position: relative; }

.tpt-city-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--tpt-bg-card);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--tpt-radius-full);
    color: var(--tpt-text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* FIX: Button hover - keep dark text */
.tpt-city-btn:hover {
    background: #EDE5D8;
    border-color: var(--tpt-primary);
    color: var(--tpt-text);
}

.tpt-city-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 260px;
    background: #FFFFFF;
    border-radius: var(--tpt-radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 100;
}

.tpt-city-picker.is-open .tpt-city-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tpt-city-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: var(--tpt-radius-sm);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.tpt-city-search:focus {
    outline: none;
    border-color: var(--tpt-primary);
}

.tpt-city-list { max-height: 200px; overflow-y: auto; list-style: none; }

.tpt-city-item {
    padding: 10px 12px;
    border-radius: var(--tpt-radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--tpt-text-secondary);
    transition: all 0.15s ease;
}

.tpt-city-item:hover {
    background: #F0E6D3;
    color: var(--tpt-text);
}

/* GRID */
.tpt-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
}

@media (max-width: 800px) {
    .tpt-grid { grid-template-columns: 1fr; }
}

/* HERO CARD */
.tpt-hero-card {
    background: var(--tpt-bg-card);
    border-radius: var(--tpt-radius);
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.tpt-next-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--tpt-accent);
    color: #FFFFFF;
    border-radius: var(--tpt-radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.tpt-next-name {
    font-family: var(--tpt-font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--tpt-text);
    margin-bottom: 0.5rem;
}

.tpt-next-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--tpt-primary);
    color: #FFFFFF;
    border-radius: var(--tpt-radius-full);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tpt-next-time::before {
    content: attr(data-label);
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.tpt-countdown-timer {
    font-family: var(--tpt-font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--tpt-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.25rem;
}

.tpt-countdown-sub {
    font-size: 0.75rem;
    color: var(--tpt-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* DAY PROGRESS BAR - Minimalist sun position */
.tpt-day-progress {
    width: 100%;
    max-width: 200px;
    height: 40px;
    position: relative;
    margin-top: auto;
}

.tpt-day-track {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3B82F6 0%, #FCD34D 30%, #FB923C 70%, #7C3AED 100%);
    border-radius: 2px;
}

.tpt-day-sun {
    position: absolute;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: #FCD34D;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(252, 211, 77, 0.6);
    transform: translateX(-50%);
    transition: left 1s ease;
}

.tpt-day-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--tpt-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* PRAYER CARDS */
.tpt-prayers-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .tpt-prayers-list { grid-template-columns: repeat(2, 1fr); }
}

.tpt-prayer-item {
    background: var(--tpt-bg-card);
    border-radius: var(--tpt-radius-sm);
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tpt-prayer-item[data-prayer="fajr"] { background: var(--fajr-bg); border-top: 3px solid var(--fajr-border); }
.tpt-prayer-item[data-prayer="sunrise"] { background: var(--sunrise-bg); border-top: 3px solid var(--sunrise-border); }
.tpt-prayer-item[data-prayer="dhuhr"] { background: var(--dhuhr-bg); border-top: 3px solid var(--dhuhr-border); }
.tpt-prayer-item[data-prayer="asr"] { background: var(--asr-bg); border-top: 3px solid var(--asr-border); }
.tpt-prayer-item[data-prayer="maghrib"] { background: var(--maghrib-bg); border-top: 3px solid var(--maghrib-border); }
.tpt-prayer-item[data-prayer="isha"] { background: var(--isha-bg); border-top: 3px solid var(--isha-border); }

.tpt-prayer-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.tpt-prayer-item.is-passed { opacity: 0.5; filter: grayscale(0.3); }
.tpt-prayer-item.is-passed .tpt-prayer-time { text-decoration: line-through; }

.tpt-prayer-item.is-active {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(196, 30, 58, 0.2);
    border: 2px solid var(--tpt-accent);
    border-top-width: 3px;
}

.tpt-prayer-icon { font-size: 1.25rem; color: var(--tpt-text-secondary); }
.tpt-prayer-name { font-size: 0.7rem; font-weight: 600; color: var(--tpt-text-secondary); text-transform: uppercase; letter-spacing: 0.1em; }
.tpt-prayer-time { font-family: var(--tpt-font-display); font-size: 1.4rem; font-weight: 700; color: var(--tpt-text); }

/* FOOTER */
.tpt-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--tpt-radius-sm);
    padding: 1rem 1.25rem;
    justify-content: space-between;
}

.tpt-stat { display: flex; align-items: center; gap: 10px; }
.tpt-stat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tpt-bg-card);
    border-radius: 50%;
    font-size: 1rem;
    color: var(--tpt-primary);
}
.tpt-stat-info { display: flex; flex-direction: column; }
.tpt-stat-label { font-size: 0.65rem; text-transform: uppercase; color: var(--tpt-text-muted); letter-spacing: 0.08em; }
.tpt-stat-val { font-weight: 700; font-size: 1rem; color: var(--tpt-text); }

/* RTL */
.tpt-container[dir="rtl"] {
    --tpt-font-display: "Cairo", sans-serif;
    --tpt-font-body: "Cairo", sans-serif;
    direction: rtl;
    text-align: right;
}

.tpt-container[dir="rtl"] .tpt-prayer-time,
.tpt-container[dir="rtl"] .tpt-countdown-timer,
.tpt-container[dir="rtl"] .tpt-next-time,
.tpt-container[dir="rtl"] .tpt-stat-val {
    direction: ltr;
    unicode-bidi: isolate;
}

.tpt-glass { background: transparent; backdrop-filter: none; border: none; box-shadow: none; }
