/* ============================================
   Torah Tracker — Landing / Onboarding
   ============================================ */

/* Remove #app constraints when landing is active */
body.landing-active #app {
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 0;
}

/* ---- Container ---- */
.landing-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    z-index: 1;
}

/* ---- Card wrapper (mobile: fills container, desktop: centered card) ---- */
.landing-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    min-height: 0;
}

/* ---- Slide Track ---- */
.landing-track {
    display: flex;
    flex: 1;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.landing-track.dragging {
    transition: none;
}

/* ---- Individual Slide ---- */
.landing-slide {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}

.landing-slide-icon {
    font-size: 72px;
    margin-bottom: 32px;
    line-height: 1;
}

.landing-slide h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
    color: var(--text-primary);
}

.landing-slide p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 340px;
}

.landing-slide .landing-subtitle {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

/* ---- Feature pills on slides ---- */
.landing-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
    max-width: 360px;
}

.landing-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.landing-feature-icon {
    font-size: 18px;
    line-height: 1;
}

/* ---- CTA Slide (last slide) ---- */
.landing-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-top: 32px;
}

.landing-cta-buttons .btn-primary {
    padding: 16px;
    font-size: 17px;
    border-radius: 14px;
}

.landing-cta-signin {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--accent-blue);
    cursor: pointer;
    padding: 12px;
    font-weight: 500;
}

.landing-cta-signin:active {
    opacity: 0.7;
}

/* ---- Bottom Controls (dots + arrows) ---- */
.landing-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 32px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 24px;
}

/* ---- Dot Indicators ---- */
.landing-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.landing-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--text-tertiary);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.landing-dot.active {
    width: 24px;
    background: var(--accent-blue);
}

/* ---- Arrow Buttons (desktop only, hidden on mobile) ---- */
.landing-arrow {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, background 0.2s;
    flex-shrink: 0;
}

.landing-arrow:hover {
    background: var(--bg-elevated);
}

.landing-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ---- Skip Button ---- */
.landing-skip {
    position: absolute;
    top: 16px;
    right: 16px;
    top: calc(16px + env(safe-area-inset-top, 0px));
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    z-index: 2;
    transition: color 0.2s;
}

.landing-skip:hover {
    color: var(--text-primary);
}

/* ---- Download App Link ---- */
.landing-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.landing-download:hover {
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.landing-download:active {
    opacity: 0.7;
}

/* ============================================
   Desktop: centered card layout
   ============================================ */
@media (min-width: 768px) {
    .landing-container {
        align-items: center;
        justify-content: center;
        background: var(--bg-primary);
    }

    .landing-card {
        max-width: 600px;
        width: 90%;
        background: var(--bg-card);
        border-radius: 20px;
        border: 1px solid var(--border-subtle);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        max-height: 85dvh;
        box-shadow: 0 8px 40px rgba(0,0,0,0.3);
        margin-left: 0;
    }

    .landing-arrow {
        display: flex;
    }

    .landing-skip {
        /* Position relative to the card, not viewport */
        position: absolute;
        top: calc(16px + env(safe-area-inset-top, 0px));
        right: 16px;
    }
}

/* ============================================
   Light Theme
   ============================================ */
[data-theme="light"] .landing-card {
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
}

[data-theme="light"] .landing-feature {
    background: #F2F2F7;
    border-color: rgba(0,0,0,0.06);
}

/* ============================================
   Capacitor native overrides
   ============================================ */
body.capacitor-native .landing-skip {
    top: calc(16px + max(env(safe-area-inset-top, 0px), 28px));
}

body.capacitor-native .landing-controls {
    padding-bottom: calc(24px + max(env(safe-area-inset-bottom, 0px), 32px));
}

body.capacitor-native .landing-download {
    display: none;
}
