/*
 * Mobile / PWA UX helpers — only active at <= 768px.
 * Targets selectors used by home, profile, notifications, settings,
 * and the "my_*" dashboard pages.
 */

/* Apple-style scroll reveal animation utility */
.pwa-reveal {
    opacity: 1;
    transform: none;
}

@media (max-width: 768px) {
    /* ===== Scroll reveal (mobile only) ===== */
    .pwa-reveal {
        opacity: 0;
        transform: translateY(28px) scale(0.96);
        transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: opacity, transform;
    }
    .pwa-reveal.in-view {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    .pwa-reveal[data-pwa-delay="1"].in-view { transition-delay: 0.08s; }
    .pwa-reveal[data-pwa-delay="2"].in-view { transition-delay: 0.16s; }
    .pwa-reveal[data-pwa-delay="3"].in-view { transition-delay: 0.24s; }

    /* ===== Home hero compression ===== */
    .home-hero {
        padding: 1.75rem 0 1rem !important;
        min-height: 0 !important;
    }
    .home-hero .display-3 {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    .home-hero .lead {
        font-size: 0.9rem !important;
        margin-bottom: 1.25rem !important;
    }
    .home-hero .badge.bg-white { font-size: 0.7rem; }
    .home-hero .row.py-5 { padding-top: 1rem !important; padding-bottom: 0 !important; }
    .home-hero .btn-lg {
        padding: 0.55rem 1.15rem !important;
        font-size: 0.9rem !important;
    }

    /* Yaklaşanlar (agenda) on mobile — collapse spacing */
    .agenda-card {
        padding: 1rem !important;
        border-radius: 16px !important;
    }

    /* Role cards: tighter, more native feel */
    .role-section { margin-top: 1rem !important; margin-bottom: 1.5rem !important; }
    .role-card {
        padding: 1.15rem !important;
        gap: 0.85rem !important;
        border-radius: 16px !important;
    }
    .role-card h3 {
        font-size: 1.05rem !important;
        margin-bottom: 0.35rem !important;
    }
    .role-card p {
        font-size: 0.82rem !important;
        margin-bottom: 0.85rem !important;
    }
    .role-card > div:first-child {
        width: 46px !important;
        height: 46px !important;
        font-size: 1.05rem !important;
    }
    .role-card .btn {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.9rem !important;
    }

    /* Quick-access cards */
    .quick-access-card {
        padding: 1.25rem !important;
    }

    /* ===== Profile page ===== */
    .profile-hero-wrapper { height: 160px !important; border-radius: 0.85rem !important; }
    .profile-hero-avatar { width: 96px !important; height: 96px !important; border-width: 3px !important; }
    .profile-badges-overlay { top: 0.5rem !important; left: 0.5rem !important; }
    .profile-header-card {
        margin-top: -1.75rem !important;
        padding: 1rem !important;
        border-radius: 14px !important;
    }
    .profile-title { font-size: 1.25rem !important; }
    .profile-header-card .text-end {
        text-align: center !important;
        justify-content: center !important;
    }
    .profile-header-card .btn { font-size: 0.82rem; padding: 0.4rem 0.95rem; }

    .detail-card { margin-bottom: 1rem !important; border-radius: 14px !important; }
    .detail-card-header { padding: 0.7rem 1rem !important; }
    .detail-card-title { font-size: 0.82rem !important; }
    .detail-card-body { padding: 0.85rem !important; }

    /* Profile: hide sticky behavior */
    .sticky-column { position: static !important; top: auto !important; }

    /* ===== Notifications inbox ===== */
    .notif-hero-wrapper { height: 110px !important; border-radius: 0.85rem !important; }
    .notif-hero-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.15rem !important;
    }
    .notif-hero-title { font-size: 1.15rem !important; }
    .notif-hero-inner { gap: 0.5rem !important; }
    .notif-header-card {
        margin-top: -1.5rem !important;
        padding: 0.85rem 1rem !important;
        border-radius: 14px !important;
    }
    .notif-header-card .d-flex.flex-wrap > .d-flex {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.85rem;
        padding: 0 0.85rem;
    }
    .notif-header-card .d-flex.flex-wrap > .d-flex::-webkit-scrollbar { display: none; }
    .filter-chip { flex-shrink: 0; font-size: 0.78rem !important; padding: 0.3rem 0.7rem !important; }
    .notif-item { padding: 0.85rem 1rem !important; gap: 0.7rem !important; }
    .notif-avatar { width: 36px !important; height: 36px !important; font-size: 0.85rem; }
    .notif-title { font-size: 0.88rem !important; }
    .notif-message { font-size: 0.82rem !important; }
    .notif-time { font-size: 0.68rem !important; }
    .notif-actions .btn-sm { font-size: 0.72rem; padding: 0.25rem 0.65rem; }

    /* ===== Settings page (stat + quick-link cards) ===== */
    .stat-card { padding: 1rem !important; border-radius: 16px !important; }
    .stat-card .icon-box {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.1rem !important;
        margin-bottom: 0.75rem !important;
        border-radius: 12px !important;
    }
    .stat-card h3 { font-size: 1.4rem !important; }
    .quick-link-card .card-body { padding: 1rem !important; }
    .quick-link-card .fs-4 { font-size: 1.15rem !important; }
    #clubs .club-item { padding: 0.75rem !important; }

    /* ===== Generic page header compression for "my_*" dashboards ===== */
    .mobile-compact-page-header h1,
    .mobile-compact-page-header .page-title {
        font-size: 1.4rem !important;
        margin-bottom: 0.25rem !important;
    }
    .mobile-compact-page-header p,
    .mobile-compact-page-header .page-lead {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }
    .mobile-compact-page-header { margin-bottom: 1rem !important; }

    /* Hide bulky decorative blocks on mobile via this opt-in class */
    .hide-mobile { display: none !important; }

    /* ===== "My_*" dashboard cards (premium-compact-card) ===== */
    .premium-compact-card {
        border-radius: 16px !important;
    }
    .premium-compact-card.mb-5 {
        margin-bottom: 1rem !important;
        padding: 0.75rem !important;
    }
    .premium-compact-card.mb-4 { margin-bottom: 0.85rem !important; }
    .premium-compact-card.mb-3 { margin-bottom: 0.7rem !important; }
    .stat-pill {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.78rem;
    }
}

/* ===== Page transition loading indicator (mobile only) ===== */
.pwa-nav-loader {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
.pwa-nav-loader.is-active {
    opacity: 1;
    pointer-events: auto;
}
.pwa-nav-loader__bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    z-index: 9999;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    transition: width 0.4s ease, opacity 0.2s ease;
    opacity: 0;
}
.pwa-nav-loader.is-active .pwa-nav-loader__bar {
    opacity: 1;
}
.pwa-nav-loader__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border-radius: 50%;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    animation: pwa-nav-spin 0.8s linear infinite;
}
@keyframes pwa-nav-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .pwa-nav-loader,
    .pwa-nav-loader__bar { transition: none; }
    .pwa-nav-loader__spinner { animation: none; }
}

/* Small phones tighten further */
@media (max-width: 420px) {
    .home-hero .display-3 { font-size: 1.55rem !important; }
    .role-card { padding: 1rem !important; }
    .profile-title { font-size: 1.15rem !important; }
}
