/*
Theme Name: My Nusuk Omra
Theme URI: https://example.com
Author: Agent
Author URI: https://example.com
Description: Un thème applicatif optimisé mobile pour guider pas à pas lors du rite de la Omra.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mynusukomra
*/

:root {
    /* Islamic / Premium Color Palette */
    --primary: #114232;
    /* Deep Dark Green */
    --primary-light: #1A5F49;
    --primary-dark: #09261D;
    --accent: #D4AF37;
    /* Elegant Gold */
    --accent-light: #E4C66A;

    /* Neutral Colors - Light Mode */
    --bg-base: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-arabic: 'Amiri', serif;

    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(17, 66, 50, 0.08);
    --shadow-floating: 0 12px 32px rgba(17, 66, 50, 0.15);
}

[data-theme="dark"] {
    --bg-base: #0F172A;
    --surface: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3 {
    color: var(--accent);
}

.arabic-text {
    font-family: var(--font-arabic);
    font-size: 1.75rem;
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .arabic-text {
    color: var(--accent);
}

.phonetic-text {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.translation-text {
    font-weight: 500;
}

/* Header */
.app-header {
    background-color: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1rem;
    transition: background-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.app-logo {
    height: 72px;
    /* Increased from 48px to 72px for better visibility */
    width: auto;
    object-fit: contain;
    transition: height 0.3s ease;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.icon-btn:hover,
.icon-btn:active {
    background-color: rgba(17, 66, 50, 0.1);
}

.icon-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

[data-theme="dark"] .icon-btn {
    color: var(--accent);
}

/* Main Container */
#app-container {
    flex: 1;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    position: relative;
    padding-bottom: 120px;
    /* Space for counter if active */
}

/* Card Styles */
.card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:active {
    transform: scale(0.98);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:active {
    background-color: var(--primary-dark);
    transform: translateY(2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--accent);
    color: var(--accent);
}

/* Selections */
.selection-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.school-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background-color: var(--surface);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.school-card.active {
    border-color: var(--accent);
    background-color: rgba(212, 175, 55, 0.05);
}

.school-card h3 {
    margin: 0;
    color: var(--text-main);
}

.school-card .check-icon {
    color: var(--accent);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.school-card.active .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Steps Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border);
}

.timeline-step {
    position: relative;
    margin-bottom: 2rem;
    cursor: pointer;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 3px solid var(--border);
    transition: all 0.3s ease;
    z-index: 2;
}

.timeline-step.completed::before {
    background-color: var(--accent);
    border-color: var(--accent);
}

.timeline-step.active::before {
    background-color: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(17, 66, 50, 0.2);
}

/* Floating Counter */
.floating-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-floating);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-counter.show {
    transform: translateX(-50%) translateY(0);
}

.counter-display {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    color: var(--accent);
}

.counter-max {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    justify-content: center;
}

.counter-btn {
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s ease;
    color: white;
}

.counter-btn:active {
    transform: scale(0.9);
}

.counter-btn.large {
    width: 72px;
    height: 72px;
    background-color: var(--accent);
    color: var(--primary-dark);
}

.counter-btn.large i {
    width: 36px;
    height: 36px;
}

.counter-btn.small {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.1);
}

.counter-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* View Transitions animations */
.fade-enter {
    animation: fadeIn 0.3s ease forwards;
}

.fade-exit {
    animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.hidden {
    display: none !important;
}

/* --- Glossary & Modal Styles --- */
.glossary-term {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
    cursor: help;
    font-weight: 500;
    transition: color 0.2s ease;
}

.glossary-term:hover,
.glossary-term:active {
    color: var(--primary);
    background-color: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
}

[data-theme="dark"] .glossary-term:hover,
[data-theme="dark"] .glossary-term:active {
    color: white;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--surface);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

/* --- Presentation & Mockup Layout --- */
.desktop-presentation {
    display: none;
}

.mobile-app-preview {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Desktop Landing Page Layout --- */
@media (min-width: 1024px) {
    body {
        background-color: var(--primary-dark);
        background-image: radial-gradient(circle at 30% 50%, rgba(212, 175, 55, 0.05), transparent 50%);
        overflow: hidden;
        /* Prevent body scrolling on desktop */
    }

    .desktop-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        height: 100vh;
        max-width: 1200px;
        margin: 0 auto;
        align-items: center;
        gap: 2rem;
    }

    .desktop-presentation {
        display: flex;
        flex-direction: column;
        justify-content: center;
        color: white;
        padding: 2rem;
    }

    .presentation-logo {
        height: 120px;
        width: auto;
        object-fit: contain;
        margin-bottom: 2rem;
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    }

    .presentation-title {
        color: var(--accent);
        font-size: 3.5rem;
        line-height: 1.1;
        margin-bottom: 1.5rem;
    }

    .presentation-desc {
        font-size: 1.25rem;
        color: rgba(255, 255, 255, 0.8);
        margin-bottom: 2.5rem;
    }

    .presentation-features {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

    .feature-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        font-size: 1.1rem;
        color: rgba(255, 255, 255, 0.9);
    }

    .feature-item i {
        color: var(--accent);
    }

    .presentation-cta {
        background: rgba(212, 175, 55, 0.1);
        border: 1px solid rgba(212, 175, 55, 0.3);
        padding: 1.5rem;
        border-radius: var(--radius-md);
        font-size: 1.15rem;
        border-left: 4px solid var(--accent);
    }

    .mobile-app-preview-container {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
        padding: 2rem;
    }

    .mobile-app-preview {
        width: 390px;
        /* iPhone approximate width */
        height: 844px;
        /* iPhone approximate height */
        min-height: auto;
        background-color: var(--bg-base);
        border: 12px solid #222;
        border-radius: 40px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        overflow: hidden;
        position: relative;
    }

    .mobile-app-preview::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 150px;
        height: 30px;
        background-color: #222;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        z-index: 1000;
    }

    .app-header {
        padding-top: 1.5rem;
        /* Space for the notch */
    }

    #app-container {
        padding-bottom: 120px;
        overflow-y: auto;
        /* Scroll inside the phone mockup */
        height: calc(100% - 70px);
    }

    .floating-counter {
        position: absolute;
        /* Relative to the phone mockup */
        bottom: 20px;
        max-width: 90%;
    }

    [data-theme="dark"] .mobile-app-preview {
        background-color: #0F172A;
    }
}