/* --- Variables & Base --- */
@font-face {
    font-family: "Zain";
    src: url("https://clinic.draghdaee.com/app/ClinicCRM/css/fonts/Zain-Regular.woff2") format("woff2");
    font-weight: 400; font-style: normal; font-display: swap;
}

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --glass: rgba(255, 255, 255, 0.05);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --success: #22c55e;
    --warning: #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Zain", sans-serif;
    line-height: 1.6;
}

/* --- Shared Components --- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px; }
.profile { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; }
.name { font-size: 16px; font-weight: 600; }
.sub { font-size: 12px; color: var(--text-muted); }

.icon-btn {
    background: var(--glass); border: none; color: white;
    width: 40px; height: 40px; border-radius: 12px;
    cursor: pointer; backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
}

.btn-primary {
    background: var(--primary); color: white; border: none;
    border-radius: 10px; padding: 10px 12px; font-family: "Zain";
    font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}

/* --- Dashboard (patient.html) Specific --- */
.content { padding: 20px; display: flex; flex-direction: column; gap: 32px; }
.quick-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card {
    background: var(--glass); border-radius: 18px; padding: 18px;
    backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.card-title { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.wallet-card { background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(99,102,241,0.05)); }
.wallet-balance { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.wallet-balance span { font-size: 13px; font-weight: 400; color: var(--text-muted); }

.timeline { display: flex; flex-direction: column; gap: 16px; }
.timeline-item { display: flex; gap: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.done .dot { background: var(--success); }
.pending .dot { background: var(--warning); }

.image-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.image-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }

.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: 70px;
    background: rgba(15,23,42,0.8); backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; justify-content: space-around; align-items: center;
}
.nav-item {
    background: none; border: none; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px;
}
.nav-item.active { color: var(--primary); }

/* --- Services Page (services.html) Specific --- */
.services-page { padding: 0 20px 30px; }
.services-hero { margin-bottom: 24px; padding: 10px 4px; }
.services-hero h1 { font-size: 26px; margin-bottom: 8px; }

.services-toolbar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.search-box input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    color: #fff;
    font-family: "Zain";
    font-size: 16px;
    outline: none;
}

/* ✅ نسخه نهایی تگ‌فیلتر، فقط برای services-page */
.services-page .tag-filter {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.services-page .tag-filter::-webkit-scrollbar {
    display: none;
}
.services-page .tag-filter button {
    flex-shrink: 0;
    scroll-snap-align: start;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 14px;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: "Zain";
    font-size: 14px;
}
.services-page .tag-filter button.active {
    background: var(--primary);
    color: #fff;
}

.services-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.service-card {
    background: var(--glass); border-radius: 16px; padding: 18px;
    border: 1px solid rgba(255,255,255,0.1); transition: 0.3s;
}
.service-top { display: flex; justify-content: space-between; align-items: center; }
.service-price {
    color: #00ffd0;
    font-weight: 700;
    font-size: 14px;
}
.tag { background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 11px; margin-right: 5px; }

/* --- Modals (Login & Service Details) --- */
.login-overlay, .service-overlay {
    position: fixed; inset: 0; backdrop-filter: blur(20px);
    background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center;
    z-index: 9999; opacity: 0; pointer-events: none; transition: 0.3s;
}
.login-overlay:not(.hidden), .service-overlay.active { opacity: 1; pointer-events: auto; }

.login-modal, .service-modal {
    width: 85%; max-width: 380px; background: var(--surface); padding: 30px;
    border-radius: 22px; border: 1px solid rgba(255,255,255,0.1);
    animation: pop 0.3s ease; position: relative;
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.service-close {
    position: absolute; top: 15px; left: 15px; background: var(--glass);
    border: none; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
}

.hidden { display: none !important; }

/* --- Luxury Login Modal Override --- */

.login-overlay {
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-modal {
    width: 88%;
    max-width: 380px;
    background: rgba(30,41,59,0.85);
    border-radius: 24px;
    padding: 26px;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.55),
        0 0 30px rgba(99,102,241,0.18);
    position: relative;
    overflow: hidden;
    animation: loginPop 0.35s ease;
}

@keyframes loginPop {
    from { opacity: 0; transform: translateY(20px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-modal::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at top right, rgba(99,102,241,0.25), transparent 60%),
        radial-gradient(circle at bottom left, rgba(56,189,248,0.2), transparent 65%);
    opacity: 0.5;
    pointer-events: none;
}

.login-title {
    color: #fff;
    font-size: 18px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.login-modal input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-family: "Zain";
    margin-top: 6px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    outline: none;
}

.login-modal input::placeholder {
    color: rgba(255,255,255,0.4);
}

.login-modal input:focus {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 1px rgba(99,102,241,0.6);
}

.login-btn {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    font-size: 15px;
    color: #fff;
    font-weight: 600;
    margin-top: 14px;
    border: none;
    box-shadow: 0 10px 25px rgba(99,102,241,0.4);
    transition: 0.2s;
    position: relative;
    z-index: 1;
    font-family: "Zain";
    cursor: pointer;
}

.login-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}

.filters{
    display:flex;
    flex-direction:column;
    gap:14px;
    }
    
    .filter-title{
    font-size:13px;
    color:var(--text-muted);
    margin-bottom:4px;
    }
    
    .filter-row{
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding-bottom:6px;
    }
    
    .filter-row button{
    flex-shrink:0;
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.1);
    padding:7px 12px;
    border-radius:10px;
    color:var(--text-muted);
    cursor:pointer;
    font-family:"Zain";
    font-size:13px;
    }
    
    .filter-row button.active{
    background:var(--primary);
    color:white;
    }

    .service-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }
    
    .service-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
    }

    .desc {
        color: var(--text-muted);
        font-size: 13px;
        margin-top: 6px;
    }

/* --- Filter Buttons: Modern, Glassy, Thin --- */

.filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* مخفی‌کردن scrollbar */
.filter-row::-webkit-scrollbar { display: none; }
.filter-row {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* دکمه‌های فیلتر */
.filter-row button {
    flex-shrink: 0;
    scroll-snap-align: start;

    padding: 6px 14px;
    font-size: 13px;

    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;

    color: var(--text-muted);

    cursor: pointer;
    transition: 
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

/* hover */
.filter-row button:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: var(--text);
}

/* active */
.filter-row button.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(99,102,241,0.35);
    transform: translateY(-1px);
}

/* فشردن دکمه */
.filter-row button:active {
    transform: translateY(0);
    box-shadow: none;
}

.mini-app-only {
    display: none;
}