* {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;

}

.header {
    box-shadow: 0 3px 15px rgba(18,140,207,0.3);
    width: 100%;
    height: fit-content;
    background-color: #ffffff;
}

.top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, #76e785, #4fd1c5);
    text-align: center;
    color: white;
}

.top-bar p ,.top-bar i {
    font-size: 13px;
    margin: 0;
}
.top-bar a ,.top-bar i{
    color: #0d3b66;
    font-weight: bold;
}
.top-bar i:hover{
    color: #ffae00;
    cursor: pointer;
}
.top-bar a:hover {
    text-decoration: underline;
}

.middle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 80px;
    background: #ffffff;

}

.logo img {
    width: 60px;
}

.search {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 20px;
    position: relative;

}

.search input {
    width: 400px;
    padding: 5px 20px;
    border-radius: 25px;
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    outline: none;
    transition: 0.7s;
}

.search input:focus {
    border-color: #127bdd;
    background: #fff;
    width: 500px;
    box-shadow: 0 0 3px rgba(4, 167, 255, 0.3);
}
.search-results-dropdown {
    display: none;
    position: absolute;
    top: 48px;
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(18,140,207,0.15);
    z-index: 100;
    overflow: hidden;
}

.search-results-dropdown.active {
    display: block;
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;

}

.search-results-header span {
    font-size: 13px;
}

.search-results-header strong {
    font-weight: 700;
}

.search-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #128CCF;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: 0.3s;
    flex-shrink: 0;
}

.search-close-btn:hover {
    background: rgba(217, 218, 255, 0.589);
}

.search-results-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 6px 0;
}

.search-results-list::-webkit-scrollbar {
    width: 4px;
}

.search-results-list::-webkit-scrollbar-track {
    background: #f5f7fb;
}

.search-results-list::-webkit-scrollbar-thumb {
    background: #128CCF;
    border-radius: 4px;
    opacity: 0.5;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    border-bottom: 1px solid #f0f8ff;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f0f8ff;
}

.result-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #128CCF;
    flex-shrink: 0;
    transition: 0.3s;
}


.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    font-size: 11px;
    color: #999;
    margin: 0;
}

.result-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 28px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    flex-shrink: 0;
}

.result-badge.doctor {
    background: #e8f4fd;
    color: #128CCF;
}

.result-badge.nurse {
    background: #e8fdf0;
    color: #1a9e5f;
}

.result-badge.service {
    background: #fff4e8;
    color: #e07c1a;
}

.search-loading {
    display: none;
    padding: 28px;
    text-align: center;
}

.search-loading.active {
    display: block;
}

.search-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e8f4fd;
    border-top-color: #128CCF;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-loading p {
    font-size: 13px;
    color: #aaa;
    font-family: 'Cairo', sans-serif;
    margin: 0;
}

.search-empty {
    display: none;
    padding: 30px 20px;
    text-align: center;
}

.search-empty.active {
    display: block;
}

.search-empty i {
    font-size: 32px;
    color: #ccc;
    margin-bottom: 8px;
    display: block;
}

.search-empty p {
    font-size: 13px;
    color: #aaa;
    font-family: 'Cairo', sans-serif;
    margin: 0;
}

.highlight {
    color: #128CCF;
    font-weight: 700;
    background: #e8f4fd;
    border-radius: 3px;
    padding: 0 2px;
}


.theme-toggle {
    margin: 0 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e8f4fd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 18px;
    color: #0f76b3;
}

.theme-toggle:hover {
    background: #128CCF; 
    color: #fff;
}
.lang {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #0f76b3;
    border-radius: 30px;
    padding: 4px 10px;
    transition: 0.3s;
    cursor: pointer;
    transition: 0.5s;
}

.lang select {
    align-self: center;
    padding: 2px 5px;
    border: none;
    outline: none;
    cursor: pointer;
    background: transparent;
    font-size: 13px;
    color: #0f76b3;
    font-weight: 600;
}

.lang i {
    font-size: 16px;
    color: #0f76b3;
}

.lang:hover {
    background: #128CCF;
}

.lang:hover i,
.lang:hover select {
    color: #fff;
}
.lang:hover option {
    color: #1a4a8a;
    font-size: 13px;

}
.nav-lang ,.nav-theme {
    display: none;
}
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #128CCF;
    padding: 8px 80px; 

}
.hamburger {
    display: none;
}
.nav a {
    color: white;
    margin-left: 20px;
    font-size: 14px;
    transition: 0.5s;
    text-decoration: none;
}
.nav a:hover {
    color: #ffd166;
}
.nav-active {
    color: #ffd166 !important;
}
.list-services {
    display: inline;
    position: relative;
}

.items-services {
    display: none;
    position: absolute;
    top: 30px;
    right: 0px;    
    z-index: 5;  
    background: #128CCF;
    list-style :none;
    padding-top: 10px;
    width: 150px;    
    border-radius: 3px;
    color: white;
    font-size: 14px;
    transition: 0.5s;

}
.items-services li {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 5px 20px 15px 20px ;
    cursor: pointer;
}
.items-services li:hover { 
    color: #ffd166;
    background: #0f76b3;
}
.list-services:hover .items-services {
    display: block;
}
.list-services:hover a{
    color: #ffd166;
}
.buttons button {
    padding: 5px 20px;
    border-radius: 28px;
    border: none;
    cursor: pointer;
    transition: 0.5s;
    font-size: 14px;

}

.join-btn {
    background: #ffd166;
}

.join-btn:hover {
    background: #ffc400;
}

.login-btn {
    background: white;
    color: #128CCF;
}

.login-btn:hover {
    background: #e6f2ff;
}

@media (max-width: 1024px) {

    .middle-header {
        padding: 8px 30px;
    }

    .search input {
        width: 250px;
    }

    .search input:focus {
        width: 300px;
    }

    .nav-bar {
        padding: 8px 30px;
    }

    .nav a {
        margin-left: 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {

    .top-bar {
        flex-wrap: wrap;
        padding: 5px 10px;
        gap: 5px;
    }

    .top-bar p {
        font-size: 12px;
    }

    .middle-header {
        padding: 8px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .search {
        order: 3;
        width: 100%;
        margin: 0;
    }

    .search input {
        width: 100%;
    }

    .search input:focus {
        width: 100%;
    }

    .search-results-dropdown {
        width: calc(100vw - 30px);
        right: 50%;
        transform: translateX(50%);
    }

    .lang select {
        padding: 5px 8px;
        font-size: 12px;
    }
    .hamburger {
        display: flex;
    }
    .nav-bar {
        padding: 8px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        position: relative;
        overflow: hidden;
        box-sizing: border-box;
    }

    .nav {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 8px;
        padding-bottom: 10px;
    }

    .nav.active {
        display: flex;
    }

    .nav a {
        margin-left: 0;
        font-size: 14px;
        padding: 4px 0;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        gap: 5px;
        padding: 5px;
        align-self: flex-end;
        position: absolute;
        left: 15px;
        top: 10px;
    }

    .hamburger span {
        display: block;
        width: 24px;
        height: 2px;
        background: white;
        border-radius: 2px;
        transition: 0.5s;
    }

    .hamburger.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.open span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    .items-services { 
        background: #0f76b3;
    }
    .buttons {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .buttons button {
        font-size: 14px;
        padding: 5px 14px;
    }
    .lang,
    .theme-toggle {
        display: none;
    }
    .lang-theme {
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        flex-direction: row;
    }
    .nav-lang,
    .nav-theme {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 4px 0;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }

    .nav-theme {
        color: white;
        cursor: pointer;
        font-size: 14px;
    }

    .nav-lang select {
        background: transparent;
        border: none;
        outline: none;
        color: white;
        font-size: 14px;
        font-family: 'Cairo', sans-serif;
        cursor: pointer;
    }

    .nav-lang i,
    .nav-theme i {
        color: white;
        font-size: 14px;
    }

    .nav-lang option {
        color: #0d3b66;
    }
}


@media (max-width: 480px) {
    .logo , .logo img {
        width: 45px ;
    }
    .buttons button {
        font-size: 14px;
        padding: 5px 14px;
    }
    .search-results-dropdown {
        width: calc(100vw - 20px);
    }

    .result-icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .result-name {
        font-size: 13px;
    }
}


body.dark-mode {
    background: #111113;
    color: #e0e0e0;
}

body.dark-mode .header {
    background: #111113;
    box-shadow: 0 3px 15px rgba(0,0,0,0.4);
}

body.dark-mode .middle-header {
    background: #111113;
}

body.dark-mode .theme-toggle {
    background: #0f3460;
    color: #ffd166;
}

body.dark-mode .search input {
    background: #0f3460;
    border-color: #1a4a8a;
    color: #e0e0e0;
}
body.dark-mode .search-results-dropdown {
    background: #16213e;
    border-top-color: #84ccf3;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

body.dark-mode .search-results-header {
    background: #0f3460;
}

body.dark-mode .search-results-header span {
    color: #e0e0e0;
}

body.dark-mode .search-result-item {
    border-color: #1a2a4a;
}

body.dark-mode .search-result-item:hover {
    background: #0f3460;
}

body.dark-mode .result-name {
    color: #e0e0e0;
}

body.dark-mode .result-icon {
    background: #0f3460;
    border-color: #1a4a8a;
    color: #84ccf3;
}

body.dark-mode .result-badge.doctor {
    background: #0f3460;
    color: #84ccf3;
}

body.dark-mode .result-badge.nurse {
    background: #0f3d28;
    color: #4ecb87;
}

body.dark-mode .result-badge.service {
    background: #3d2a0f;
    color: #f0a050;
}

body.dark-mode .search-results-footer {
    background: #0f3460;
    border-color: #1a4a8a;
    color: #84ccf3;
}

body.dark-mode .search-results-footer:hover {
    background: #1a4a8a;
}

body.dark-mode .search-loading p,
body.dark-mode .search-empty p {
    color: #888;
}

body.dark-mode .search-empty i {
    color: #555;
}
body.dark-mode .lang {
    border-color: #84ccf3;
}

body.dark-mode .lang select {
    color: #84ccf3;
}

body.dark-mode .lang i {
    color: #84ccf3;
}

body.dark-mode .lang:hover {
    background: #0f3460;
    border-color: #84ccf3;
}
body.dark-mode .top-bar {
    background: #0f3460;

}
body.dark-mode .top-bar i{
    color: #e0e0e0;

}
body.dark-mode .top-bar i:hover{
    color: #ffd166;

}
body.dark-mode .top-bar a{
    color: #ffd166;
}

body.dark-mode .nav-bar {
    background: #0f3460;
    color: #e0e0e0;

}
body.dark-mode .items-services {
    background: #123d72;
}