@font-face {
    font-family: 'Bahij';
    src: url('fonts/Bahij.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
     background: #1a9da5; 
     border-radius: 60px; 
}

/* --- CSS Variables --- */
:root {
    --bg-color: #f4f7f6;
    --surface-color: #ffffff;
    --text-main: #2b2b2b;
    --text-muted: #6c757d;
    --primary-color: #35B7B0;
    --primary-hover: #237A75;
    --primary-text: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 10px 40px rgba(0,0,0,0.08);
    --pill-radius: 50px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Global Style --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    scroll-behavior: smooth;
    /* أكواد الحماية لمنع التحديد */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

[data-theme="dark"] {
    --bg-color: #0f1115;
    --surface-color: #1a1d24;
    --text-main: #f8f9fa;
    --text-muted: #a0aab5;
    --primary-color: #35B7B0;
    --primary-hover: #237A75;
    --primary-text: #ffffff;
    --border-color: #2d323e;
    --shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* --- Global Style --- */
body { 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    transition: var(--transition); 
    overflow-x: hidden; 
}

/* Language Support Classes - Font switching */
body[lang="ku"] { font-family: 'Bahij', sans-serif; direction: rtl; text-align: right; }
body[lang="ar"] { font-family: 'Bahij', sans-serif; direction: rtl; text-align: right; }

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-on-load { animation: fadeInUp 0.8s ease forwards; }

/* --- Header & Smart Nav --- */
header {
    position: sticky; top: 0; z-index: 1000;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
}
[data-theme="dark"] header { background-color: rgba(26, 29, 36, 0.85); }

.top-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; max-height: 100px; transition: var(--transition);
}
header.scrolled .top-bar { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; }

.logo { font-size: 26px; font-weight: 800; color: var(--primary-color); display: flex; align-items: center; gap: 10px; }

.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Smart Nav Scrollable */
.smart-nav {
    display: flex; overflow-x: auto; gap: 8px; padding: 10px 5%;
    background: var(--surface-color); border-top: 1px solid var(--border-color);
    scrollbar-width: none; -ms-overflow-style: none;
}
.smart-nav::-webkit-scrollbar { display: none; }

.nav-link {
    text-decoration: none; color: var(--text-muted);
    padding: 8px 18px; border-radius: var(--pill-radius);
    font-size: 14px; font-weight: 600; white-space: nowrap;
    transition: var(--transition); border: 1px solid transparent;
}
.nav-link.active {
    background-color: var(--primary-color); color: var(--primary-text);
    box-shadow: 0 4px 15px rgba(52, 183, 176, 0.3);
}

/* --- Buttons --- */
button { cursor: pointer; border: none; outline: none; transition: var(--transition); font-family: inherit; }
.btn-icon {
    background: var(--bg-color); color: var(--text-main);
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 16px; border: 1px solid var(--border-color);
}
.btn-icon:hover { background: var(--primary-color); color: var(--primary-text); border-color: var(--primary-color); }

.btn-lang {
    padding: 5px 15px; border-radius: var(--pill-radius);
    background: var(--primary-color); color: var(--primary-text);
    font-weight: bold; font-size: 14px;
}

/* --- Hero Section --- */
#home-section {
    position: relative; width: 100%; height: 80vh;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--bg-color); overflow: hidden;
}
#particles-js { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 1; }
.home-content { position: relative; z-index: 2; text-align: center; width: 100%; }
.home-content h1 { font-size: 4.5rem; color: var(--primary-color); font-weight: 800; margin-bottom: 10px; }
.home-content p { font-size: 1.2rem; color: var(--text-muted); font-weight: 600; }

/* --- Search Bar Styles --- */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 30px auto 0;
    width: 90%;
    z-index: 10;
}
.search-container input {
    width: 100%;
    padding: 16px 45px 16px 20px;
    border-radius: var(--pill-radius);
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-main);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
}
.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(52, 183, 176, 0.2);
}
.search-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    transition: var(--transition);
}
.search-container input:focus + .search-icon {
    color: var(--primary-color);
}

/* --- Grid & Cards --- */
.container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
section { padding: 40px 0; scroll-margin-top: 140px; }

.category-title {
    font-size: 30px; font-weight: 800; margin-bottom: 25px;
    color: var(--text-main); display: flex; align-items: center; gap: 12px;
}
.category-title::after { content: ''; flex: 1; height: 2px; background: var(--border-color); }

.doctors-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px;
}
.doctors-grid.expanded .doctor-card:nth-child(n+10) { display: flex; animation: fadeInUp 0.5s ease forwards; }
.doctors-grid .doctor-card:nth-child(n+10) { display: none; opacity: 0; }

/* Styles for search filtering */
.doctors-grid.searching .doctor-card {
    display: none !important;
}
.doctors-grid.searching .doctor-card.match {
    display: flex !important;
    opacity: 1 !important;
    animation: fadeInUp 0.4s ease forwards;
}
.doctors-grid.searching + .btn-show-more {
    display: none !important;
}

.doctor-card {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 20px; padding: 25px; text-align: center;
    transition: var(--transition); box-shadow: var(--shadow);
    display: flex; flex-direction: column; align-items: center;
}
.doctor-card:hover { transform: translateY(-8px); border-color: var(--primary-color); }

.doctor-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--bg-color); display: flex; align-items: center;
    justify-content: center; font-size: 35px; color: var(--primary-color);
    margin-bottom: 15px; border: 2px solid var(--border-color);
    transition: var(--transition);
}
.doctor-card:hover .doctor-avatar { background: var(--primary-color); color: var(--primary-text); }

.doctor-name { font-size: 25px; font-weight: 800; margin-bottom: 6px; }
.doctor-spec { font-size: 14px; color: var(--text-muted); margin-bottom: 15px; font-weight: 600; }
.doctor-phone { font-size: 25px; font-weight: 700; color: var(--text-main); margin-bottom: 20px; direction: ltr; }

.btn-call {
    width: 100%; padding: 12px; border-radius: var(--pill-radius);
    background: var(--primary-color); color: var(--primary-text);
    text-decoration: none; font-weight: 700; display: inline-flex;
    align-items: center; justify-content: center; gap: 10px; margin-top: auto;
    transition: var(--transition);
}
.btn-call:hover { background: var(--primary-hover); transform: scale(1.02); }

.btn-show-more {
    display: block; margin: 40px auto 0; padding: 12px 40px;
    background: transparent; color: var(--primary-color);
    border: 2px solid var(--primary-color); border-radius: var(--pill-radius);
    font-weight: 700; font-size: 16px; transition: var(--transition); font-family: inherit;
}
.btn-show-more:hover { background: var(--primary-color); color: var(--primary-text); }

/* --- Footer (Aso4Tech Signature with Glassmorphism) --- */
footer {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    text-align: center;
    margin-top: 60px;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.03);
}
[data-theme="dark"] footer {
    background-color: rgba(26, 29, 36, 0.6);
}
footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 800;
    font-size: 18px;
    margin: 0 5px;
    position: relative;
    display: inline-block;
    transition: var(--transition);
}
footer a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
body[lang="ku"] footer a::after {
    transform-origin: bottom left;
}
footer a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}
body[lang="ku"] footer a:hover::after {
    transform-origin: bottom right;
}

#backToTop {
    position: fixed; bottom: 25px; left: 25px; width: 50px; height: 50px;
    background: var(--primary-color); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.3s; z-index: 1000; cursor: pointer;
}
#backToTop.show { opacity: 1; visibility: visible; }

@media (max-width: 768px) {
    .home-content h1 { font-size: 2.8rem; }
    .top-bar { padding: 10px 4%; }
}