/*
 * Modern Responsive Header CSS
 * MediCare Pro v3.0
 */

/* ========================================
   MODERN HEADER BASE
======================================== */
.modern-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.modern-header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
}

/* ========================================
   LOGO & BRANDING
======================================== */
.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.site-title a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.site-title a:hover {
    color: var(--color-primary);
}

.site-title i {
    color: var(--color-primary);
    font-size: 28px;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.1);
    }

    20% {
        transform: scale(1);
    }
}

.site-description {
    display: none;
    font-size: 12px;
    color: var(--color-text-light);
    margin: 0;
}

/* ========================================
   NAVIGATION
======================================== */
.main-navigation {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 10px 18px;
    color: var(--color-text);
    font-weight: 500;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--gradient-primary);
    transition: transform 0.3s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item>a {
    background: var(--color-secondary);
    color: var(--color-primary);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item>a::after {
    transform: translateX(-50%) scaleX(1);
}

/* ========================================
   HEADER ACTIONS
======================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.search-toggle,
.social-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-secondary);
    color: var(--color-primary);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.search-toggle:hover,
.social-icon:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(127, 169, 155, 0.4);
}

.header-social {
    display: flex;
    gap: 8px;
}

/* ========================================
   MOBILE MENU TOGGLE
======================================== */
.menu-toggle {
    width: 42px;
    height: 42px;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: var(--color-secondary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.menu-toggle span {
    width: 24px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--color-primary);
}

.menu-toggle:hover span {
    background: white;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========================================
   SEARCH OVERLAY
======================================== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(127, 169, 155, 0.95) 0%, rgba(44, 62, 80, 0.95) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    max-width: 700px;
    width: 90%;
    position: relative;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-close {
    position: absolute;
    top: -60px;
    right: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
}

.search-form-inner {
    display: flex;
    gap: 0;
    background: white;
    padding: 8px;
    border-radius: 60px;
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.4);
}

.search-field {
    flex: 1;
    border: none;
    padding: 18px 28px;
    font-size: 18px;
    background: transparent;
    color: var(--color-text);
    border-radius: 60px;
}

.search-field:focus {
    outline: none;
}

.search-field::placeholder {
    color: var(--color-text-light);
}

.search-submit {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 18px 35px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-submit:hover {
    transform: translateX(-5px);
    box-shadow: 0 8px 25px rgba(127, 169, 155, 0.5);
}

.search-suggestions {
    margin-top: 35px;
    text-align: center;
}

.suggestions-title {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 500;
}

.suggestions-tags {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.suggestions-tags a {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.suggestions-tags a:hover {
    background: white;
    color: var(--color-primary);
    border-color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* ========================================
   MOBILE RESPONSIVE
======================================== */
@media screen and (max-width: 1024px) {
    .main-navigation ul {
        gap: 2px;
    }

    .main-navigation a {
        padding: 8px 14px;
        font-size: 14px;
    }
}

@media screen and (max-width: 768px) {

    /* Hide desktop navigation */
    .main-navigation {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: white;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
        padding: 30px 20px;
        transition: right 0.4s ease;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        overflow-y: auto;
        z-index: 999;
    }

    .main-navigation.active {
        right: 0;
    }

    .main-navigation ul {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .main-navigation li {
        width: 100%;
    }

    .main-navigation a {
        width: 100%;
        padding: 14px 18px;
        font-size: 16px;
        border-radius: 10px;
    }

    .main-navigation a::after {
        display: none;
    }

    /* Show mobile menu toggle */
    .menu-toggle {
        display: flex;
    }

    /* Hide social icons on mobile */
    .header-social {
        display: none;
    }

    /* Header adjustments */
    .header-inner {
        padding: 12px 0;
    }

    .site-title {
        font-size: 20px;
    }

    .site-title i {
        font-size: 24px;
    }

    /* Search overlay mobile */
    .search-overlay-inner {
        width: 95%;
    }

    .search-form-inner {
        flex-direction: column;
        border-radius: 20px;
        padding: 15px;
        gap: 12px;
    }

    .search-field {
        padding: 16px 20px;
        text-align: center;
        font-size: 16px;
    }

    .search-submit {
        justify-content: center;
        border-radius: 12px;
        padding: 16px 30px;
    }

    .suggestions-tags {
        flex-direction: column;
        gap: 10px;
    }

    .suggestions-tags a {
        display: block;
        text-align: center;
    }

    .search-close {
        top: -55px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .site-title {
        font-size: 18px;
    }

    .site-title i {
        font-size: 22px;
    }

    .search-toggle {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .menu-toggle {
        width: 38px;
        height: 38px;
    }

    .menu-toggle span {
        width: 22px;
    }
}

/* Menu Overlay */
.menu-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}