/*
 * NP Booking — App-Like Mobile Experience
 * Mobile-first, modern SaaS, app-feel
 * Inspired by Fresha / Mero / Treatwell
 */

/* ═══════════════════════════════════════════════════════════
   ROOT VARIABLES
═══════════════════════════════════════════════════════════ */
:root {
    --np-primary:     #0f172a;
    --np-primary-rgb: 15, 23, 42;
    --np-accent:      #6366f1;
    --np-accent-rgb:  99, 102, 241;
    --np-success:     #10b981;
    --np-warning:     #f59e0b;
    --np-danger:      #ef4444;
    --np-surface:     #ffffff;
    --np-bg:          #f8fafc;
    --np-border:      rgba(0,0,0,.07);
    --np-shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --np-shadow-md:   0 4px 16px rgba(0,0,0,.1);
    --np-shadow-lg:   0 12px 40px rgba(0,0,0,.14);
    --np-radius-sm:   10px;
    --np-radius-md:   16px;
    --np-radius-lg:   24px;
    --np-radius-xl:   32px;
    --np-nav-h:       72px;
    --np-top-h:       64px;
    --np-transition:  0.2s cubic-bezier(.4,0,.2,1);
    --np-spring:      0.35s cubic-bezier(.34,1.56,.64,1);
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL RESETS (mobile-only)
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    * { -webkit-tap-highlight-color: transparent; }

    html {
        scroll-behavior: smooth;
        scroll-padding-top: calc(var(--np-top-h) + 12px);
        -webkit-text-size-adjust: 100%;
    }
    body {
        background: #ffffff;
        overscroll-behavior-y: none;
        -webkit-font-smoothing: antialiased;
    }

    /* Remove ALL bottom navs — Fresha style (no bottom navigation) */
    .mobile-nav,
    .bottom-nav,
    .mobile-bottom-nav,
    nav[class*="bottom-nav"],
    nav[class*="mobile-nav"] { display: none !important; }
    /* Remove all bottom padding that was compensating for the bottom nav */
    main,
    .main-content { margin-bottom: 0 !important; padding-bottom: 0 !important; }
    footer { margin-bottom: 0 !important; }

    /* Page entry animation */
    main > * { animation: npPageIn 0.3s ease both; }
    @keyframes npPageIn {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE APP HEADER — always hidden (pill nav serves as header)
═══════════════════════════════════════════════════════════ */
.np-mobile-header {
    display: none !important;
}
@media (max-width: 767px) {
    /* Push main content below the flattened pill nav */
    main.flex-grow {
        padding-top: 56px;
    }
}

/* ═══════════════════════════════════════════════════════════
   TOP NAVIGATION — Compact on tablet
═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
    nav.flex.justify-center.w-full.px-4.fixed {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
    nav .flex.items-center.justify-between.px-6.py-3 {
        padding: 10px 14px !important;
    }
    nav .max-w-4xl {
        max-width: 100% !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   FLOATING PILL NAV — Fresha-style flat header on mobile
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    /* Outer wrapper: flat, full-width, white — like Fresha */
    .np-floating-pill-nav {
        padding: 0 !important;
        background: #ffffff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        box-shadow: none !important;
    }
    /* Inner pill: no pill shape, full width, 56px height */
    .np-floating-pill-nav > div:first-child {
        border-radius: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 20px !important;
        height: 56px !important;
        background: transparent !important;
    }
    /* Sidebar overlay starts below header */
    .np-floating-pill-nav .fixed.inset-0 {
        top: 56px !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE SIDEBAR — Fresha-style full-screen clean menu
═══════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .np-floating-pill-nav .fixed.inset-0 {
        background: #ffffff !important;
        padding-top: 72px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .np-floating-pill-nav .fixed.inset-0 .flex.flex-col.space-y-4 a {
        padding: 14px 20px !important;
        border-radius: 12px !important;
        font-size: 17px !important;
        font-weight: 500 !important;
        color: #111 !important;
        transition: background 0.15s;
    }
    .np-floating-pill-nav .fixed.inset-0 .flex.flex-col.space-y-4 a:active {
        background: rgba(0,0,0,0.04);
    }
    .np-floating-pill-nav .flex.items-center.gap-4.p-4 {
        border-radius: 16px !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   FRESHA-STYLE BUSINESS CARDS — Clean, professional
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .biz-card {
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        border: none !important;
    }
    .biz-card:active {
        transform: scale(0.97) !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
    }
    .biz-card-overlay {
        background: linear-gradient(to top, rgba(0,0,0,0.15) 0%, transparent 40%) !important;
    }
    .biz-card-img {
        aspect-ratio: 4/3 !important;
    }
    .biz-card-body {
        padding: 10px 12px 12px !important;
    }
    .biz-card-name {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #111111 !important;
        margin-bottom: 4px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    .biz-card-rating-row {
        display: flex;
        align-items: center;
        gap: 3px;
        margin-bottom: 3px;
    }
    .biz-card-rating-val {
        font-size: 13px;
        font-weight: 700;
        color: #111;
    }
    .biz-card-rating-count {
        font-size: 12px;
        color: #666;
        font-weight: 400;
    }
    .biz-card-meta {
        font-size: 12px !important;
        color: #666666 !important;
        font-weight: 400 !important;
        margin: 0 0 2px 0 !important;
        display: block !important;
    }
    .biz-card-footer {
        display: none !important;
    }
    .biz-card-rating {
        bottom: auto !important;
        top: 8px !important;
        right: 8px !important;
        background: rgba(255,255,255,0.95) !important;
        color: #111 !important;
        font-size: 11px !important;
        padding: 3px 7px !important;
        border-radius: 6px !important;
    }
    .biz-card-rating i { color: #f59e0b !important; }
    .explore-biz-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 !important;
    }
    .explore-body { padding-bottom: 32px !important; }
    .explore-sticky { top: 56px !important; }
    .explore-root { background: #f7f7f7 !important; }
}

/* ═══════════════════════════════════════════════════════════
   CARD SYSTEM — Consistent look
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .np-card,
    .bg-white.rounded-2xl,
    .bg-white.rounded-xl {
        border-radius: var(--np-radius-md) !important;
        border: 1px solid var(--np-border);
        box-shadow: var(--np-shadow-sm);
    }
    [onclick].bg-white,
    a.bg-white.rounded-2xl,
    a.bg-white.rounded-xl {
        transition: transform var(--np-transition), box-shadow var(--np-transition);
    }
    [onclick].bg-white:active,
    a.bg-white.rounded-2xl:active,
    a.bg-white.rounded-xl:active {
        transform: scale(0.98);
        box-shadow: var(--np-shadow-sm);
    }
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS — Touch-friendly & modern
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .btn-primary,
    button[type="submit"]:not(.np-no-style),
    .bg-gray-900.text-white,
    .bg-slate-900.text-white {
        min-height: 52px;
        border-radius: var(--np-radius-md) !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        letter-spacing: 0.01em;
        transition: all var(--np-transition) !important;
    }
    .btn-primary:active,
    button[type="submit"]:not(.np-no-style):active {
        transform: scale(0.97);
        filter: brightness(0.95);
    }
    button:not(.np-no-style),
    [role="button"],
    a[class*="rounded"] {
        -webkit-tap-highlight-color: transparent;
        tap-highlight-color: transparent;
    }
}

/* ═══════════════════════════════════════════════════════════
   FORMS — App-like inputs
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
        min-height: 52px;
        border-radius: var(--np-radius-md) !important;
        padding: 14px 16px !important;
        border: 1.5px solid #e2e8f0 !important;
        background: white !important;
        transition: border-color var(--np-transition), box-shadow var(--np-transition);
        -webkit-appearance: none;
        appearance: none;
    }
    input:focus, select:focus, textarea:focus {
        border-color: var(--np-primary) !important;
        box-shadow: 0 0 0 3px rgba(15,23,42,0.08) !important;
        outline: none;
    }
    textarea { min-height: 100px; resize: vertical; }
}

/* ═══════════════════════════════════════════════════════════
   SKELETON LOADERS
═══════════════════════════════════════════════════════════ */
@keyframes npSkeleton {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.np-skeleton {
    background: linear-gradient(90deg, #f0f4f8 25%, #e8edf2 50%, #f0f4f8 75%);
    background-size: 800px 100%;
    animation: npSkeleton 1.6s ease-in-out infinite;
    border-radius: var(--np-radius-sm);
}
.np-skeleton-text   { height: 14px; border-radius: 7px; }
.np-skeleton-title  { height: 20px; border-radius: 10px; }
.np-skeleton-avatar { border-radius: 50%; }
.np-skeleton-card {
    background: white;
    border-radius: var(--np-radius-md);
    border: 1px solid var(--np-border);
    padding: 16px;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════════════════════ */
.np-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 48px 24px; text-align: center; gap: 12px;
}
.np-empty-icon {
    width: 80px; height: 80px; border-radius: 24px; background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; margin-bottom: 8px;
}
.np-empty h3 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0; }
.np-empty p  { font-size: 14px; color: #64748b; margin: 0; max-width: 240px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   PAGE TRANSITION
═══════════════════════════════════════════════════════════ */
.page-loader { background: white !important; backdrop-filter: none !important; }
.loader-spinner {
    border-color: #e2e8f0 !important;
    border-top-color: var(--np-primary) !important;
    width: 36px !important; height: 36px !important; border-width: 3px !important;
}

@media (max-width: 767px) {
    @keyframes npSlideUp {
        from { opacity: 0; transform: translateY(16px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .np-slide-up { animation: npSlideUp 0.4s var(--np-spring) both; }
    .np-slide-up:nth-child(2) { animation-delay: 0.05s; }
    .np-slide-up:nth-child(3) { animation-delay: 0.1s; }
    .np-slide-up:nth-child(4) { animation-delay: 0.15s; }
    .np-stagger > * { animation: npSlideUp 0.4s var(--np-spring) both; }
    .np-stagger > *:nth-child(1) { animation-delay: 0.0s; }
    .np-stagger > *:nth-child(2) { animation-delay: 0.06s; }
    .np-stagger > *:nth-child(3) { animation-delay: 0.12s; }
    .np-stagger > *:nth-child(4) { animation-delay: 0.18s; }
    .np-stagger > *:nth-child(5) { animation-delay: 0.24s; }
}

/* ═══════════════════════════════════════════════════════════
   COOKIE BANNER
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    #cookieBanner [x-show] {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }
    #cookieBanner button[title="Setări cookie-uri"] { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   HORIZONTAL SCROLL CHIPS / TABS
═══════════════════════════════════════════════════════════ */
.np-chips {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
    -ms-overflow-style: none; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.np-chips::-webkit-scrollbar { display: none; }
.np-chip {
    flex-shrink: 0; padding: 8px 16px; border-radius: 100px;
    background: white; border: 1.5px solid #e2e8f0; font-size: 13px;
    font-weight: 600; color: #475569; cursor: pointer;
    transition: all var(--np-transition); white-space: nowrap; hyphens: none;
}
.np-chip:active { transform: scale(0.95); }
.np-chip.active { background: var(--np-primary); border-color: var(--np-primary); color: white; }

/* ═══════════════════════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .np-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
    .np-section-title  { font-size: 18px; font-weight: 700; color: var(--np-primary); letter-spacing: -0.02em; }
    .np-section-link   { font-size: 13px; font-weight: 600; color: var(--np-accent); }
}

/* ═══════════════════════════════════════════════════════════
   LISTS
═══════════════════════════════════════════════════════════ */
.np-list-item {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: white; border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background var(--np-transition); text-decoration: none;
}
.np-list-item:first-child { border-radius: var(--np-radius-md) var(--np-radius-md) 0 0; }
.np-list-item:last-child  { border-radius: 0 0 var(--np-radius-md) var(--np-radius-md); border-bottom: none; }
.np-list-item:only-child  { border-radius: var(--np-radius-md); }
.np-list-item:active      { background: #f8fafc; }
.np-list-icon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 20px; }
.np-list-body { flex: 1; min-width: 0; }
.np-list-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.np-list-sub   { font-size: 13px; color: #64748b; margin-top: 1px; }
.np-list-chevron { color: #cbd5e1; font-size: 14px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   BADGE / PILLS
═══════════════════════════════════════════════════════════ */
.np-badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: 100px; font-size: 11px; font-weight: 700;
    white-space: nowrap; hyphens: none; letter-spacing: 0.02em;
}
.np-badge-success { background: #dcfce7; color: #15803d; }
.np-badge-warning { background: #fef3c7; color: #b45309; }
.np-badge-danger  { background: #fee2e2; color: #b91c1c; }
.np-badge-info    { background: #e0f2fe; color: #0369a1; }
.np-badge-purple  { background: #ede9fe; color: #6d28d9; }
.np-badge-dark    { background: #1e293b; color: white; }

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════════════════ */
.np-toast-container {
    position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 12px; right: 12px; z-index: 9990;
    display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none;
}
@media (min-width: 768px) {
    .np-toast-container { bottom: 24px; left: auto; right: 24px; width: 360px; }
}
.np-toast {
    background: #1e293b; color: white; border-radius: var(--np-radius-md);
    padding: 14px 16px; display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 500; box-shadow: var(--np-shadow-lg);
    pointer-events: auto; animation: npToastIn 0.4s var(--np-spring) both;
}
@keyframes npToastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.np-toast.success { background: #065f46; }
.np-toast.error   { background: #7f1d1d; }
.np-toast.warning { background: #78350f; }
.np-toast-icon    { font-size: 18px; flex-shrink: 0; }
.np-toast-dismiss { margin-left: auto; opacity: 0.6; cursor: pointer; font-size: 16px; padding: 2px; }

/* ═══════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .np-sheet-handle { width: 36px; height: 4px; background: #e2e8f0; border-radius: 2px; margin: 0 auto 16px; }
    .np-sheet {
        position: fixed; bottom: 0; left: 0; right: 0; background: white;
        border-radius: var(--np-radius-xl) var(--np-radius-xl) 0 0;
        padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px));
        z-index: 200; box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
        max-height: 85dvh; overflow-y: auto;
    }
}

/* ═══════════════════════════════════════════════════════════
   SCROLL X
═══════════════════════════════════════════════════════════ */
.np-scroll-x {
    display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none;
    padding-bottom: 8px; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
}
.np-scroll-x::-webkit-scrollbar { display: none; }
.np-scroll-x > * { scroll-snap-align: start; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════════════ */
.np-divider { height: 8px; background: var(--np-bg); margin: 0 -16px; }
@media (max-width: 767px) {
    .np-full-bleed { margin-left: -16px; margin-right: -16px; }
    .np-section { padding: 20px 16px; background: white; border-bottom: 1px solid var(--np-border); }
    .np-container { padding-left: 16px; padding-right: 16px; }
}
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 0px); }
.pt-safe { padding-top: env(safe-area-inset-top, 0px); }

/* ═══════════════════════════════════════════════════════════
   TABLET ADAPTATIONS
═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
    .np-page-title { font-size: 32px; }
    .np-container  { padding: 0 24px; }
    .np-scroll-x   { gap: 16px; }
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}