/* style.css - Compressed version */
:root {
    --bg-1: #07142b;
    --bg-2: #0b63a6;
    --card-bg: rgba(255, 255, 255, .06);
    --glass: rgba(255, 255, 255, .06);
    --accent: #ffd166;
    --muted: rgba(255, 255, 255, .8);
    --muted-2: rgba(255, 255, 255, .65);
    --success: #4caf50;
    --error: #ff6b6b;
    --current-prayer: #ff6b6b;
    --next-prayer: #4caf50;
    --shadow: 0 8px 30px rgba(2, 6, 23, .6);
    --radius: 14px
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: 'Inter', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
    background: linear-gradient(180deg, var(--bg-1) 0%, #071c36 20%, #052a4e 50%, #03203f 80%, #021019 100%);
    background-attachment: fixed;
    color: var(--muted);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh
}

.app {
    width: 100%;
    max-width: 980px
}

header.app-header {
    position: sticky;
    top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, .04);
    backdrop-filter: blur(6px) saturate(120%);
    z-index: 100
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.brand .logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 18px;
    background: linear-gradient(to bottom, red, red);
    color: #fff
}

.brand .title {
    font-weight: 700;
    color: var(--muted);
    line-height: 1
}

.brand .subtitle {
    font-size: 12px;
    color: var(--muted-2)
}

nav.primary {
    display: flex;
    align-items: center;
    gap: 12px
}

.nav-link {
    color: var(--muted-2);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px
}

.nav-link:hover {
    background: rgba(255, 255, 255, .02);
    color: var(--muted)
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--muted);
    border-radius: 3px;
    transition: all .3s ease
}

.layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 18px;
    margin-top: 18px
}

.panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .02));
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 12px 40px rgba(2, 6, 23, .5);
    border: 1px solid rgba(255, 255, 255, .04)
}

.province-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap
}

label.select-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 14px
}

select.province-select {
    appearance: none;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(180deg, rgba(11, 99, 166, .9), rgba(7, 20, 43, .9));
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 4px 12px rgba(0, 0, 0, .2);
    min-width: 200px;
    cursor: pointer;
    outline: none;
    border: 1px solid rgba(255, 255, 255, .2);
    font-family: 'Inter', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
    transition: all .2s ease;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px
}

select.province-select:hover {
    background: linear-gradient(180deg, rgba(11, 99, 166, .95), rgba(7, 20, 43, .95));
    border: 1px solid rgba(255, 255, 255, .3)
}

select.province-select:focus {
    background: linear-gradient(180deg, rgba(11, 99, 166, 1), rgba(7, 20, 43, 1));
    border: 1px solid var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 209, 102, .3)
}

select.province-select option {
    background: #0a1a2f;
    color: #fff;
    padding: 12px;
    font-size: 14px
}

#locationStatus {
    font-size: 13px;
    margin-left: auto;
    color: var(--muted-2)
}

.big-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-top: 14px
}

.sub {
    font-size: 14px;
    color: var(--muted-2);
    font-weight: 700;
    margin-top: 24px;
    margin-left: 5px
}

.datetime {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    flex-wrap: wrap
}

.clock-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01));
    padding: 14px;
    border-radius: 12px;
    min-width: 160px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .03)
}

#currentTime {
    font-size: 24px;
    font-weight: 800;
    color: var(--error)
}

#currentDate,
#hijriDate {
    font-size: 18px;
    color: var(--accent)
}

.prayer-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 18px
}

.pray-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01));
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, .03);
    transition: all .3s ease
}

.pray-card .name {
    font-weight: 700;
    color: var(--muted)
}

.pray-card .time {
    margin-left: auto;
    font-weight: 800;
    color: #fff
}

.pray-card .eng {
    font-size: 12px;
    color: var(--muted-2)
}

.highlight {
    background: linear-gradient(90deg, var(--accent), #ffb84d);
    color: #052033
}

.highlight .name,
.highlight .eng,
.highlight .time {
    color: #052033
}

.current-prayer {
    background: linear-gradient(90deg, var(--current-prayer), #ff8a8a);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 107, .4);
    transform: scale(1.02);
    border: 1px solid rgba(255, 255, 255, .2)
}

.current-prayer .name,
.current-prayer .eng,
.current-prayer .time {
    color: var(--bg-1);
    font-weight: 800
}

.next-prayer {
    background: linear-gradient(90deg, var(--next-prayer), #6bcf6b);
    color: #fff;
    box-shadow: 0 4px 15px rgba(76, 175, 80, .4);
    border: 1px solid rgba(255, 255, 255, .2)
}

.next-prayer .name,
.next-prayer .eng,
.next-prayer .time {
    color: var(--bg-1);
    font-weight: 800
}

.detail {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    padding: 18px;
    min-height: 320px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01));
    border: 1px solid rgba(255, 255, 255, .03)
}

.detail .place {
    font-weight: 800;
    color: #fff;
    font-size: 18px
}

.detail .coords {
    font-size: 12px;
    color: var(--muted-2);
    margin-top: 6px
}

.detail .mini-map {
    height: 170px;
    background: linear-gradient(180deg, #02243a, #013a57);
    border-radius: 10px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-2);
    font-size: 14px
}

.footer {
    margin-top: 18px;
    text-align: center;
    color: var(--muted-2);
    font-size: 13px
}

.prayer-status {
    background: linear-gradient(135deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
    border-radius: 12px;
    padding: 14px;
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, .05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2)
}

.prayer-status-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px
}

.prayer-status-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px
}

.current-prayer-info {
    display: flex;
    flex-direction: column
}

.current-prayer-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--current-prayer)
}

.current-prayer-time {
    font-size: 14px;
    color: var(--muted)
}

.next-prayer-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end
}

.next-prayer-label {
    font-size: 12px;
    color: var(--muted-2)
}

.next-prayer-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--next-prayer)
}

.countdown {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    margin-top: 4px
}

@media (max-width:980px) {
    .layout {
        grid-template-columns: 1fr
    }

    .detail {
        order: 2
    }
}

@media (max-width:768px) {
    .hamburger {
        display: flex
    }

    nav.primary {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, rgba(11, 99, 166, .95), rgba(7, 20, 43, .95));
        backdrop-filter: blur(10px) saturate(180%);
        border-radius: 0 0 var(--radius) var(--radius);
        box-shadow: 0 10px 30px rgba(2, 6, 23, .8);
        border: 1px solid rgba(255, 255, 255, .1);
        border-top: none;
        border-bottom: none;
        flex-direction: column;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease, padding .3s ease
    }

    nav.primary.active {
        max-height: 300px;
        padding: 15px 0
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        border-radius: 0;
        color: rgba(255, 255, 255, .9);
        font-weight: 500;
        transition: all .2s ease;
        border-bottom: 1px solid rgba(255, 255, 255, .05)
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, .1);
        color: #fff
    }

    .nav-link:last-child {
        border-bottom: none
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg)
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg)
    }

    select.province-select {
        min-width: 100%;
        margin-top: 8px
    }

    .province-row {
        flex-direction: column;
        align-items: flex-start
    }

    #locationStatus {
        margin-left: 0;
        margin-top: 8px
    }

    .prayer-status-content {
        flex-direction: column;
        align-items: flex-start
    }

    .next-prayer-info {
        align-items: flex-start;
        margin-top: 10px
    }
}

.content-list {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px
}

.content-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    margin: 15px 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
    transition: background .2s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .02)
}

.content-item:hover {
    background: rgba(255, 255, 255, .08)
}

.content-thumb {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 8px;
    background: var(--bg-2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
    font-size: 14px;
    color: #fff;
    position: relative
}

.content-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.content-body {
    display: flex;
    flex-direction: column;
    justify-content: center
}

.content-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    line-height: 1.3
}

.content-description {
    font-size: 12px;
    color: var(--muted-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis
}

.featured-section {
    margin-top: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .02));
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 12px 40px rgba(2, 6, 23, .5);
    border: 1px solid rgba(255, 255, 255, .04)
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff
}

.view-all {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600
}

.view-all:hover {
    text-decoration: underline
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 12px
}

.calendar-header {
    text-align: center;
    font-weight: 700;
    color: var(--accent);
    font-size: 12px;
    padding: 8px 0
}

.calendar-day {
    text-align: center;
    padding: 10px 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .02);
    transition: all .2s ease;
    cursor: pointer
}

.calendar-day:hover {
    background: rgba(255, 255, 255, .05)
}

.calendar-day.current {
    background: var(--accent);
    color: #052033;
    font-weight: 700
}

.calendar-day.hijri {
    border: 1px solid var(--success)
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, .02);
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted);
    transition: all .2s ease;
    border: 1px solid rgba(255, 255, 255, .03)
}

.quick-link:hover {
    background: rgba(255, 255, 255, .05);
    transform: translateY(-2px)
}

.quick-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bg-2), #0a94d1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px
}

.quick-link-text {
    font-weight: 600;
    font-size: 14px
}

.community-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px
}

.stat-card {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, .02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .03)
}

.stat-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px
}

.stat-label {
    font-size: 12px;
    color: var(--muted-2)
}

.dua-card {
    background: linear-gradient(135deg, rgba(11, 99, 166, .1), rgba(255, 209, 102, .05));
    border-radius: 12px;
    padding: 18px;
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    position: relative
}

.dua-arabic {
    font-size: 20px;
    text-align: center;
    margin-bottom: 12px;
    color: var(--accent);
    font-family: 'Traditional Arabic', 'Times New Roman', serif
}

.dua-translation {
    font-size: 14px;
    text-align: center;
    color: var(--muted);
    line-height: 1.5
}

.dua-reference {
    font-size: 12px;
    text-align: center;
    color: var(--muted-2);
    margin-top: 8px
}


.ads-container {
    margin: 15px -18px
}

/*
.ads-container {
    margin: 25px auto; 
    max-width: 728px; 
    text-align: center; 
}

 ------------------------------------------- */
/* แก้ไข: บังคับให้โฆษณา Responsive ทำงานบนมือถือ */
/* ------------------------------------------- 
@media (max-width: 768px) {
    .ads-container {
        max-width: 100%; 
        margin: 15px 0; 
        overflow: hidden; 
        padding: 0 5px;
    }
    
    .ads-container ins.adsbygoogle {
        width: 100% !important;
        min-height: 50px; 
    }
}
*/
.province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 12px
}

.province-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, .03);
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted);
    transition: all .2s ease;
    border: 1px solid rgba(255, 255, 255, .03);
    font-size: 14px;
    font-weight: 500
}

.province-link:hover {
    background: rgba(255, 255, 255, .08);
    transform: translateY(-2px);
    color: var(--accent)
}

.province-link.current-province {
    background: linear-gradient(135deg, rgba(11, 99, 166, .2), rgba(255, 209, 102, .1));
    border: 1px solid rgba(255, 209, 102, .3);
    color: var(--accent);
    font-weight: 700
}

@media (max-width:768px) {
    .province-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr))
    }
}

@media (max-width:520px) {
    .province-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .province-link {
        padding: 10px 12px;
        font-size: 13px
    }

    .content-item {
        flex-direction: row
    }

    .content-thumb {
        width: 60px;
        height: 60px;
        min-width: 60px
    }

    .content-title {
        font-size: 13px
    }

    .content-description {
        font-size: 11px
    }

    #currentTime {
        font-size: 22px
    }

    .prayer-list {
        grid-template-columns: 1fr
    }

    .brand .logo {
        width: 40px;
        height: 40px
    }

    header.app-header {
        padding: 12px 15px
    }

    .clock-card {
        width: 100%
    }
}

.fade-in {
    animation: fadeUp .6s ease both
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes pulse {
    0% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.02)
    }

    100% {
        transform: scale(1)
    }
}

.pulse {
    animation: pulse 1s ease-in-out
}