/* ================================================================
   Alfajri Prayer Times Plugin — style.css
   Design: Elegant Islamic geometric, deep teal & gold palette
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Tajawal:wght@400;500;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --apt-bg:        #0b1e2d;
    --apt-surface:   #122535;
    --apt-border:    rgba(180,148,70,.25);
    --apt-gold:      #c9a84c;
    --apt-gold-lt:   #e8c97a;
    --apt-teal:      #2fc5c5;
    --apt-text:      #e8e2d5;
    --apt-muted:     #8a9ba8;
    --apt-active-bg: rgba(201,168,76,.13);
    --apt-active-border: #c9a84c;
    --apt-radius:    18px;
    --apt-font-head: 'Playfair Display', Georgia, serif;
    --apt-font-body: 'Tajawal', 'Segoe UI', sans-serif;
    --apt-shadow:    0 8px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.3);
}

/* ── Wrapper ────────────────────────────────────────────────── */
.apt-wrap {
    --apt-bg: #0b1e2d; /* re-declare so child SVG can reference */
    position: relative;
    background: var(--apt-bg);
    border-radius: var(--apt-radius);
    box-shadow: var(--apt-shadow);
    overflow: hidden;
    font-family: var(--apt-font-body);
    color: var(--apt-text);
    border: 1px solid var(--apt-border);
}

/* ── Geometric SVG background ───────────────────────────────── */
.apt-geo {
    position: absolute;
    inset: 0;
    color: var(--apt-gold);
    pointer-events: none;
    opacity: .55;
    z-index: 0;
}
.apt-geo svg { width: 100%; height: 100%; }

/* ── Header ─────────────────────────────────────────────────── */
.apt-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 30px 32px 24px;
    border-bottom: 1px solid var(--apt-border);
    background: linear-gradient(135deg, rgba(201,168,76,.1) 0%, transparent 60%);
}

.apt-crescent {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    color: var(--apt-gold);
    filter: drop-shadow(0 0 10px rgba(201,168,76,.6));
    animation: apt-float 4s ease-in-out infinite;
}

@keyframes apt-float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

.apt-header-text { flex: 1; }

.apt-title {
    font-family: var(--apt-font-head);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--apt-gold-lt);
    margin: 0 0 2px;
    line-height: 1.2;
    letter-spacing: .02em;
}

.apt-city {
    font-size: .9rem;
    font-weight: 700;
    color: var(--apt-teal);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin: 0;
}

.apt-date {
    font-size: .82rem;
    color: var(--apt-muted);
    margin: 3px 0 0;
}

.apt-hijri {
    font-size: .78rem;
    color: var(--apt-gold);
    opacity: .8;
    margin: 1px 0 0;
}

/* ── Clock ──────────────────────────────────────────────────── */
.apt-clock {
    font-family: 'Courier New', monospace;
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--apt-teal);
    letter-spacing: .06em;
    text-shadow: 0 0 12px rgba(47,197,197,.5);
    white-space: nowrap;
}

/* ── Next Prayer Banner ─────────────────────────────────────── */
.apt-next-banner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 32px;
    background: linear-gradient(90deg, rgba(201,168,76,.18) 0%, rgba(201,168,76,.06) 100%);
    border-bottom: 1px solid var(--apt-border);
    font-size: .85rem;
}

/* Baris atas/bawah tidak dipakai lagi */
.apt-next-row-top, .apt-next-row-bottom { display: contents; }

.apt-next-label {
    color: var(--apt-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    flex-shrink: 0;
}

.apt-next-name {
    color: var(--apt-gold-lt);
    font-weight: 700;
}

.apt-next-countdown {
    color: var(--apt-teal);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin-left: auto;
    font-size: .92rem;
}

/* ── Prayer Grid ────────────────────────────────────────────── */
.apt-grid {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 12px 0;
}

.apt-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 32px;
    border-left: 3px solid transparent;
    transition: background .25s, border-color .25s;
    position: relative;
}

.apt-row:hover {
    background: rgba(255,255,255,.04);
}

.apt-row.is-active {
    background: var(--apt-active-bg);
    border-left-color: var(--apt-active-border);
}

.apt-row.is-active .apt-active-dot {
    display: block;
}

.apt-active-dot {
    display: none;
    position: absolute;
    right: 28px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--apt-gold);
    box-shadow: 0 0 8px var(--apt-gold);
    animation: apt-pulse 1.5s ease-in-out infinite;
}

@keyframes apt-pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .5; transform: scale(1.5); }
}

.apt-icon {
    font-size: 1.4rem;
    width: 36px;
    text-align: center;
    filter: drop-shadow(0 0 4px rgba(255,255,255,.2));
}

.apt-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: var(--apt-text);
    letter-spacing: .02em;
}

.apt-time {
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--apt-gold-lt);
    letter-spacing: .06em;
}

/* ── Watermark dalam banner ─────────────────────────────────── */
.apt-watermark {
    margin-left: auto;
    font-size: .62rem;
    color: var(--apt-muted);
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .75;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Tombol Download Foto ───────────────────────────────────── */
.apt-download-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: calc(100% - 40px);
    margin: 14px 20px;
    padding: 10px 18px;
    background: rgba(201,168,76,.12);
    border: 1px solid rgba(201,168,76,.35);
    border-radius: 10px;
    color: var(--apt-gold-lt);
    font-family: var(--apt-font-body);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .1s;
}
.apt-download-btn:hover {
    background: rgba(201,168,76,.22);
    border-color: rgba(201,168,76,.6);
}
.apt-download-btn:active { transform: scale(.97); }
.apt-download-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.apt-download-btn.apt-loading {
    opacity: .7;
    pointer-events: none;
}

/* ================================================================
   WIDGET STYLES
   ================================================================ */

.apt-widget {
    max-width: 100%;
}

.apt-widget-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--apt-border);
}

.apt-w-crescent {
    width: 34px;
    height: 34px;
    color: var(--apt-gold);
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(201,168,76,.5));
}

.apt-w-title {
    font-family: var(--apt-font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--apt-gold-lt);
    line-height: 1.2;
}

.apt-w-city {
    font-size: .72rem;
    color: var(--apt-teal);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 700;
}

.apt-w-clock {
    font-size: .95rem;
    margin-left: auto;
}

.apt-w-date {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    padding: 8px 18px;
    border-bottom: 1px solid var(--apt-border);
    font-size: .75rem;
    color: var(--apt-muted);
    gap: 2px;
}

.apt-w-hijri {
    color: var(--apt-gold);
    opacity: .8;
    font-size: .7rem;
}

/* Widget list */
.apt-w-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    position: relative;
    z-index: 1;
}

.apt-w-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-left: 3px solid transparent;
    transition: background .2s, border-color .2s;
    font-size: .88rem;
}

.apt-w-row:hover { background: rgba(255,255,255,.04); }

.apt-w-row.is-active {
    background: var(--apt-active-bg);
    border-left-color: var(--apt-active-border);
}

.apt-w-icon { font-size: 1rem; width: 24px; text-align: center; }
.apt-w-name { flex: 1; color: var(--apt-text); }
.apt-w-time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--apt-gold-lt);
    font-size: .88rem;
    letter-spacing: .04em;
}

/* Widget next banner */
.apt-w-next {
    padding: 8px 18px;
    font-size: .78rem;
    border-top: 1px solid var(--apt-border);
    border-bottom: none;
    gap: 3px;
}

/* Widget download button — lebih compact */
.apt-widget .apt-download-btn {
    width: calc(100% - 28px);
    margin: 10px 14px;
    padding: 8px 14px;
    font-size: .76rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .apt-header  { flex-wrap: wrap; gap: 10px; padding: 20px 18px 16px; }
    .apt-clock   { width: 100%; text-align: center; font-size: 1.1rem; }
    .apt-row     { padding: 11px 18px; }
    .apt-next-banner { padding: 9px 18px; }
    .apt-footer  { padding: 10px; }
    .apt-title   { font-size: 1.2rem; }
}
