/**
 * MyTasbih Counter Page Components
 * Beads, Modals, Hadith Panel, Focus Mode
 * 
 * @package MyTasbih Theme
 * @version 1.0.0
 */

/* ========================================
   Beads Animation
   ======================================== */
.beads-wrap {
    position: relative;
    width: 100%;
    height: clamp(35px, 6vh, 50px);
    overflow: visible;
    flex-shrink: 0;
}

.beads-svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

.bead-string {
    stroke: #5a4030;
    stroke-width: 2;
    stroke-linecap: round;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
    fill: none;
}

.page-wrapper.dark .bead-string {
    stroke: #7a6050;
}

.beads-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bead {
    position: absolute;
    width: clamp(16px, 3vh, 24px);
    height: clamp(16px, 3vh, 24px);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    transition: left .5s cubic-bezier(.4, 0, .2, 1), top .5s cubic-bezier(.4, 0, .2, 1);
    background: radial-gradient(ellipse at 28% 22%, rgba(255, 230, 200, .35) 0%, transparent 50%),
                radial-gradient(ellipse at 72% 78%, rgba(40, 20, 10, .5) 0%, transparent 50%),
                radial-gradient(circle, #a67c52 0%, #8b5a3c 40%, #6b4028 70%, #4a2c1a 100%);
    box-shadow: inset 2px 2px 5px rgba(255, 220, 180, .2),
                inset -2px -2px 6px rgba(40, 20, 10, .6),
                0 3px 8px rgba(0, 0, 0, .35);
}

.bead::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: repeating-linear-gradient(var(--g, 35deg), transparent 0 3px, rgba(60, 35, 20, .2) 3px 4px, transparent 4px 8px);
    opacity: .6;
}

.bead::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 5px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, .35) 0%, transparent 70%);
    border-radius: 50%;
    transform: rotate(-35deg);
}

.bead.pulse {
    animation: beadPulse .4s;
}

@keyframes beadPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.12); filter: brightness(1.15); }
}

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    max-width: 300px;
    margin: 12px;
    animation: popIn .4s cubic-bezier(.34, 1.56, .64, 1);
}

.page-wrapper.dark .modal-box {
    background: #2d3748;
}

/* Wider modal for FR/RU (longer button labels) */
body.french-page .modal-box,
body.russian-page .modal-box {
    max-width: 340px;
}

@keyframes popIn {
    from { transform: scale(.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-icon {
    font-size: 40px;
    margin-bottom: 8px;
    animation: bounce .6s ease infinite alternate;
}

@keyframes bounce {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
}

.modal-text {
    font-size: 15px;
    margin-bottom: 8px;
}

.modal-hadith {
    font-size: 13px;
    font-style: italic;
    color: #718096;
    padding: 8px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.page-wrapper.dark .modal-hadith {
    background: #1a202c;
    color: #a0aec0;
}

.modal-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: nowrap;
}

.modal-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #e2e8f0;
    color: var(--text);
    transition: transform .15s;
    outline: none;
    white-space: nowrap;
}

.modal-btn:active {
    transform: scale(.95);
}

.page-wrapper.dark .modal-btn {
    background: #4a5568;
    color: var(--text-dark);
}

.modal-btn.primary {
    background: var(--accent);
    color: #1a1a1a;
}

/* ========================================
   Share Modal
   ======================================== */
.share-box {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    text-align: center;
    max-width: 300px;
    margin: 12px;
    animation: popIn .4s cubic-bezier(.34, 1.56, .64, 1);
    position: relative;
}

.page-wrapper.dark .share-box {
    background: #2d3748;
}

.share-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    color: #718096;
}

.page-wrapper.dark .share-close {
    background: #4a5568;
    color: #a0aec0;
}

.share-card {
    width: 240px;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin: 0 auto 12px;
    background: linear-gradient(145deg, #1a3a4a 0%, #0d2633 50%, #1a3a4a 100%);
    box-shadow: 0 5px 20px rgba(0, 0, 0, .3);
}

.card-pattern {
    position: absolute;
    inset: 0;
    opacity: .1;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 16px, rgba(212, 175, 55, .3) 16px, rgba(212, 175, 55, .3) 17px),
                      repeating-linear-gradient(90deg, transparent, transparent 16px, rgba(212, 175, 55, .3) 16px, rgba(212, 175, 55, .3) 17px);
}

.card-pattern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 2px solid rgba(212, 175, 55, .15);
    border-radius: 50%;
}

.card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: #fff;
}

.card-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.card-arabic {
    font-family: 'Amiri', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.card-dhikr {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, .9);
    margin-bottom: 14px;
}

.card-msg {
    font-size: 12px;
    color: rgba(255, 255, 255, .8);
    line-height: 1.4;
    padding: 8px 10px;
    background: rgba(255, 255, 255, .1);
    border-radius: 6px;
    margin-bottom: 10px;
}

.card-brand {
    font-size: 9px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.share-btns {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    background: var(--accent);
    color: #1a1a1a;
    transition: transform .15s;
    outline: none;
}

.share-btn:active {
    transform: scale(.95);
}

/* ========================================
   Hadith Panel
   ======================================== */
.hadith-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #5a4a2a;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-left: none;
    border-radius: 0 10px 10px 0;
    padding: 12px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
    transition: all .25s;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hadith-toggle:hover {
    background: #fff;
    box-shadow: 3px 0 16px rgba(212, 175, 55, 0.15);
}

.page-wrapper.dark .hadith-toggle {
    background: rgba(26, 26, 46, 0.95);
    color: #e0c97f;
    border-color: rgba(224, 201, 127, 0.2);
}

.hadith-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    background: #fff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 9000;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hadith-panel.open {
    transform: translateX(0);
}

.page-wrapper.dark .hadith-panel {
    background: #1a1a2e;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.hadith-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    flex-shrink: 0;
}

.hadith-panel-title {
    font-family: 'Amiri', serif;
    font-size: 16px;
    font-weight: 700;
    color: #d4af37;
}

.hadith-panel-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: all .2s;
    padding: 0;
}

.hadith-panel-close:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
}

.hadith-panel-content {
    padding: 20px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hadith-panel-bismillah {
    font-family: 'Amiri', serif;
    font-size: 18px;
    color: #d4af37;
    text-align: center;
    opacity: 0.8;
}

.hadith-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.25), transparent);
}

.hadith-panel-arabic {
    font-family: 'Amiri', serif;
    font-size: 18px;
    color: #2d3748;
    line-height: 2;
    text-align: center;
    direction: rtl;
    padding: 16px;
    background: rgba(212, 175, 55, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.page-wrapper.dark .hadith-panel-arabic {
    color: #f0e8d0;
    background: rgba(224, 201, 127, 0.06);
    border-color: rgba(224, 201, 127, 0.12);
}

.hadith-panel-text {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.7;
    text-align: center;
    font-style: italic;
}

.page-wrapper.dark .hadith-panel-text {
    color: #d0d0d0;
}

.hadith-panel-source {
    font-size: 11px;
    color: #d4af37;
    text-align: center;
    font-weight: 600;
}

.page-wrapper.dark .hadith-panel-source {
    color: #e0c97f;
}

/* ========================================
   Focus Mode
   ======================================== */
.page-wrapper.focus-mode .top-nav,
.page-wrapper.focus-mode .header,
.page-wrapper.focus-mode .bottom,
.page-wrapper.focus-mode .beads-wrap,
.page-wrapper.focus-mode .hadith-toggle {
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s;
}

.page-wrapper.focus-mode {
    background: linear-gradient(180deg, #0a0a12 0%, #12121f 50%, #0a0a12 100%);
    overflow: hidden;
    height: 100vh;
    touch-action: none;
}

.page-wrapper.focus-mode::before {
    opacity: 0;
}

.page-wrapper.focus-mode::after {
    background: radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, .08) 0%, transparent 60%);
}

.page-wrapper.focus-mode .main {
    justify-content: center;
    gap: 20px;
    padding-bottom: 2vh;
}

.page-wrapper.focus-mode .counter-wrap {
    width: clamp(180px, 30vh, 240px);
    height: clamp(180px, 30vh, 240px);
    animation: gentlePulse 4s ease-in-out infinite;
}

.page-wrapper.focus-mode .count-num {
    font-size: clamp(40px, 8vh, 72px);
    color: #fff;
}

.page-wrapper.focus-mode .count-goal {
    color: rgba(255, 255, 255, .5);
}

.page-wrapper.focus-mode .ring-bg {
    stroke: rgba(255, 255, 255, .1);
}

.page-wrapper.focus-mode .dhikr-box {
    margin-top: 10px;
}

.page-wrapper.focus-mode .dhikr-main {
    font-size: clamp(20px, 3.5vh, 28px);
    color: var(--accent);
    text-shadow: 0 0 30px rgba(212, 175, 55, .3);
}

.page-wrapper.focus-mode .dhikr-arabic {
    font-size: clamp(16px, 3vh, 22px);
    color: rgba(255, 255, 255, .7);
}

.page-wrapper.focus-mode .controls {
    margin-top: 10px;
}

.page-wrapper.focus-mode .btn-main {
    width: clamp(70px, 12vh, 100px) !important;
    height: clamp(70px, 12vh, 100px) !important;
    min-width: clamp(70px, 12vh, 100px) !important;
    min-height: clamp(70px, 12vh, 100px) !important;
    font-size: clamp(32px, 6vh, 50px);
    box-shadow: 0 0 40px rgba(212, 175, 55, .4);
}

.page-wrapper.focus-mode .btn-side {
    opacity: 0.3;
}

.page-wrapper.focus-mode .btn-side:hover {
    opacity: 1;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.focus-exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all .3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.focus-exit-btn:hover {
    background: rgba(255, 255, 255, .2);
}

.page-wrapper.focus-mode .focus-exit-btn {
    opacity: 1;
    pointer-events: auto;
}

.focus-breathe {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .4);
    font-size: 11px;
    letter-spacing: 1px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s;
    white-space: nowrap;
}

.page-wrapper.focus-mode .focus-breathe {
    opacity: 1;
    animation: breatheText 8s ease-in-out infinite;
}

@keyframes breatheText {
    0%, 100% { opacity: .3; }
    50% { opacity: .6; }
}

/* ========================================
   Responsive
   ======================================== */
/* Focus Mode Mobile Optimization */
@media (max-width: 480px) {
    .page-wrapper.focus-mode .main {
        gap: 16px;
        justify-content: center;
        padding-bottom: 10vh;
    }
    
    .page-wrapper.focus-mode .controls {
        gap: 16px;
        margin-top: 12px;
    }
    
    .page-wrapper.focus-mode .dhikr-box {
        margin-top: 8px;
    }
    
    .focus-breathe {
        font-size: 11px;
        bottom: 20px;
        letter-spacing: 0.5px;
    }
    
    .focus-exit-btn {
        top: 12px;
        right: 12px;
        padding: 10px 16px;
        font-size: 12px;
    }
}

@media (max-height: 700px) {
    .page-wrapper.focus-mode .main {
        gap: 12px;
        padding-bottom: 6vh;
    }
    
    .focus-breathe {
        font-size: 10px;
        bottom: 15px;
    }
}

@media (max-height: 600px) {
    .page-wrapper.focus-mode .main {
        gap: 8px;
        padding-bottom: 4vh;
    }
    
    .focus-breathe {
        font-size: 9px;
        bottom: 10px;
    }
}

@media (max-height: 500px) {
    .page-wrapper.focus-mode .main {
        gap: 6px;
        padding-bottom: 2vh;
    }
    
    .focus-exit-btn {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 10px;
    }
}

@media (max-height: 580px) {
    .app { padding: 3px 10px 2px; }
    .counter-page .header { margin-bottom: 1px; }
    .counter-page .brand-logo { width: 32px !important; height: 32px !important; }
    .brand-name { font-size: 12px; }
    .brand-tagline { font-size: 7px; }
    .counter-wrap { width: 90px; height: 90px; }
    .ring-bg, .ring-bar { stroke-width: 7; }
    .count-num { font-size: 24px; }
    .btn-main { width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; font-size: 20px; }
    .btn-side { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; max-width: 34px !important; max-height: 34px !important; font-size: 15px; }
    .controls { gap: 8px; }
    .goal-btn { padding: 3px 8px; font-size: 9px; }
    .beads-wrap { height: 44px; }
    .bead { width: 20px; height: 20px; }
    .icon-btn { width: 24px !important; height: 24px !important; min-width: 24px !important; min-height: 24px !important; font-size: 10px !important; }
    .lang-select { height: 24px !important; font-size: 9px !important; padding: 0 14px 0 4px !important; }
}

@media (max-height: 500px) {
    .top-nav { padding: 2px 6px; }
    .nav-link { font-size: 9px; }
    .app { padding: 2px 8px; }
    .counter-page .brand-logo { width: 28px !important; height: 28px !important; }
    .brand-name { font-size: 11px; }
    .brand-tagline { font-size: 6px; }
    .counter-wrap { width: 75px; height: 75px; }
    .ring-bg, .ring-bar { stroke-width: 6; }
    .count-num { font-size: 20px; }
    .count-goal { font-size: 9px; }
    .dhikr-main { font-size: 12px; }
    .dhikr-arabic { font-size: 10px; }
    .btn-main { width: 38px !important; height: 38px !important; min-width: 38px !important; min-height: 38px !important; font-size: 18px; }
    .btn-side { width: 30px !important; height: 30px !important; min-width: 30px !important; min-height: 30px !important; max-width: 30px !important; max-height: 30px !important; font-size: 13px; }
    .goal-btn { padding: 2px 6px; font-size: 8px; }
    .goal-input { width: 36px !important; min-width: 36px !important; max-width: 36px !important; font-size: 8px !important; }
    .dhikr-select { padding: 3px 5px; font-size: 9px; margin-bottom: 2px; }
    .stats { padding: 4px; margin-bottom: 2px; }
    .stat-val { font-size: 11px; }
    .beads-wrap { height: 38px; }
    .bead { width: 18px; height: 18px; }
    .icon-btn { width: 22px !important; height: 22px !important; min-width: 22px !important; min-height: 22px !important; font-size: 9px !important; }
    .lang-select { height: 22px !important; font-size: 8px !important; }
}

@media (max-height: 420px) {
    .top-nav { display: none; }
    .stats { display: none; }
    .beads-wrap { height: 32px; }
}

/* ========================================
   Mobile Tasbih Bead Ring
   ======================================== */
.mobile-bead-ring {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

@media (max-width: 768px) {
    .mobile-bead-ring {
        display: block;
    }
    /* Hide SVG progress ring on mobile */
    .counter-wrap .progress-ring {
        display: none;
    }
    /* Hide bottom beads on mobile */
    .beads-wrap {
        display: none !important;
    }
}

@media (max-width: 380px) {
    .counter-wrap {
        width: 170px !important;
        height: 170px !important;
    }
}

/* Bead ring SVG styles */
.mobile-bead-ring .bead-string-bg {
    stroke: #c4d4e4;
    stroke-width: 4.5;
    fill: none;
    opacity: 1;
}

.mobile-bead-ring .bead-string-progress {
    stroke: #d4af37;
    stroke-width: 4.5;
    fill: none;
    opacity: 1;
    stroke-linecap: round;
}

.mobile-bead-ring .moving-bead {
    filter: none;
}

.mobile-bead-ring .bead-highlight {
    fill: rgba(255,255,255,0.3);
    pointer-events: none;
}

.mobile-bead-ring .tasbih-head {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

/* Dark mode bead ring */
.page-wrapper.dark .mobile-bead-ring .bead-string-bg {
    stroke: #5a6570;
    opacity: 1;
}

.page-wrapper.dark .mobile-bead-ring .bead-string-progress {
    stroke: #e0b830;
    opacity: 1;
}

.page-wrapper.dark .mobile-bead-ring .moving-bead {
    filter: none;
}

/* Focus mode - hide mobile bead ring, show SVG ring */
.page-wrapper.focus-mode .mobile-bead-ring {
    display: none !important;
}

@media (max-width: 768px) {
    .page-wrapper.focus-mode .counter-wrap .progress-ring {
        display: block;
    }
}



/* ========================================
   Sunnah Mode (After Salah Guided Dhikr)
   ======================================== */

/* Mode Toggle */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: clamp(4px, 1vh, 8px);
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    padding: 4px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.page-wrapper.dark .mode-toggle {
    background: rgba(255, 255, 255, 0.06);
}

.mode-btn {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: #718096;
    transition: all 0.2s;
    outline: none;
    white-space: nowrap;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
    justify-content: center;
}

.mode-btn.active {
    background: var(--accent);
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.mode-btn:not(.active):hover {
    color: var(--accent);
    background: rgba(212, 175, 55, 0.1);
}

.mode-btn:focus,
.mode-btn:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.mode-btn:not(.active):active {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
}

.page-wrapper.dark .mode-btn {
    color: #a0aec0;
}

.page-wrapper.dark .mode-btn.active {
    background: var(--accent);
    color: #1a1a1a;
}

/* Sunnah Phase Indicator */
.sunnah-phases {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 8px;
    padding: 0 10px;
}

.phase-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.phase-dot-inner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid #cbd5e0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
}

.phase-dot-inner::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.4s ease;
}

.phase-dot.active .phase-dot-inner {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
    animation: sunnahPulse 2s ease-in-out infinite;
}

.phase-dot.active .phase-dot-inner::after {
    background: var(--accent);
}

.phase-dot.completed .phase-dot-inner {
    border-color: var(--accent);
    background: var(--accent);
}

.phase-dot.completed .phase-dot-inner::after {
    content: '✓';
    background: none;
    width: auto;
    height: auto;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}

@keyframes sunnahPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 18px rgba(212, 175, 55, 0.5); }
}

.phase-label {
    font-size: 9px;
    font-weight: 600;
    color: #a0aec0;
    white-space: nowrap;
    transition: color 0.3s;
}

.phase-dot.active .phase-label {
    color: var(--accent);
}

.phase-dot.completed .phase-label {
    color: var(--accent);
}

.page-wrapper.dark .phase-dot-inner {
    border-color: #4a5568;
}

.page-wrapper.dark .phase-label {
    color: #5a6570;
}

.page-wrapper.dark .phase-dot.active .phase-label,
.page-wrapper.dark .phase-dot.completed .phase-label {
    color: var(--accent);
}

/* Phase connecting line */
.phase-line {
    width: 36px;
    height: 2.5px;
    background: #cbd5e0;
    margin: 0 4px;
    margin-bottom: 18px;
    border-radius: 2px;
    transition: background 0.4s ease;
}

.phase-line.filled {
    background: var(--accent);
}

.page-wrapper.dark .phase-line {
    background: #4a5568;
}

.page-wrapper.dark .phase-line.filled {
    background: var(--accent);
}

/* Sunnah mode phase transition */
.sunnah-transition .counter-wrap,
.sunnah-transition .dhikr-box {
    animation: sunnahFade 0.5s ease;
}

@keyframes sunnahFade {
    0% { opacity: 1; transform: scale(1); }
    40% { opacity: 0.3; transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1); }
}

/* Sunnah Completion Modal */
.sunnah-complete-count {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    font-family: 'Amiri', serif;
}

/* Hide elements in sunnah mode */
.page-wrapper.sunnah-active .goal-row {
    display: none;
}

.page-wrapper.sunnah-active .dhikr-change-hint {
    display: none;
}

.page-wrapper.sunnah-active button.dhikr-box,
.page-wrapper.sunnah-active button.dhikr-box:hover {
    cursor: default;
    border-bottom-color: transparent !important;
}

/* Focus mode hides sunnah UI */
.page-wrapper.focus-mode .mode-toggle,
.page-wrapper.focus-mode .sunnah-phases {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .mode-toggle {
        max-width: 190px;
        margin-bottom: 6px;
    }
    .mode-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    .phase-dot-inner {
        width: 24px;
        height: 24px;
    }
    .phase-dot.completed .phase-dot-inner::after {
        font-size: 11px;
    }
    .phase-label {
        font-size: 8px;
    }
    .phase-line {
        width: 28px;
        margin-bottom: 16px;
    }
    .sunnah-phases {
        margin-bottom: 6px;
    }
}

@media (max-width: 380px) {
    .mode-toggle {
        max-width: 170px;
    }
    .mode-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
    .phase-line {
        width: 22px;
    }
}

/* ========================================
   Offline Indicator (Req 28.4)
   Subtle icon in counter header, visible
   only when the device is offline.
   ======================================== */
.offline-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border: 2px solid #e2a308;
    border-radius: 6px;
    background-color: rgba(234, 179, 8, 0.1);
    color: #e2a308;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.offline-indicator--visible {
    display: inline-flex;
    opacity: 1;
}

.page-wrapper.dark .offline-indicator {
    background-color: rgba(234, 179, 8, 0.15);
    border-color: #ca8a04;
    color: #facc15;
}

@media (max-width: 480px) {
    .offline-indicator {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }
    .offline-indicator svg {
        width: 12px;
        height: 12px;
    }
}


/* ════════════════════════════════════════════════
   SVG Icon Alignment (buttons)
   ════════════════════════════════════════════════ */

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5a5a6a;
}

.icon-btn svg {
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

.page-wrapper.dark .icon-btn {
    color: #b0b0c0;
}

.icon-btn:hover {
    color: #d4af37;
}

.ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn svg {
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

.modal-btn,
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modal-btn svg,
.share-btn svg {
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

.mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mode-btn svg {
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}


/* Inspiration Panel Sections */
.inspiration-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inspiration-section__label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #d4af37;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inspiration-section__label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.3), transparent);
}

.page-wrapper.dark .inspiration-section__label {
    color: #e0c97f;
}
