/* Shared Navigation Styles for SignSpeak */

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-toggle {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .menu-toggle {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Header styles */
header {
    background-color: white;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    position: relative;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Navigation styles */
nav {
    display: flex;
    gap: 2rem;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    cursor: pointer;
    padding: 0;
    background: none;
    border: none;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation dropdown styles */
.nav-item {
    position: relative;
}

.dropdown-toggle::after {
    content: " ▼";
    font-size: 0.7rem;
    margin-left: 0.3rem;
    color: currentColor;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 180px;
    z-index: 1000;
    border: 1px solid #e2e8f0;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    border-radius: 0;
    transition: background-color 0.2s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.dropdown-menu a:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.nav-item:hover .dropdown-menu,
.nav-item.active .dropdown-menu {
    display: block;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: none;
    border: none;
    display: inline-block;
}

nav a:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* Active state styles */
nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-toggle.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-menu a.active:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .header-content {
        padding: 0.5rem 1rem;
    }

    header h1 {
        font-size: 1.3rem;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        display: none;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    nav.mobile-active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .nav-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    nav a {
        display: block;
        padding: 0.75rem;
        border-radius: var(--border-radius);
        margin-bottom: 0.25rem;
        font-size: 1rem;
    }

    .dropdown-toggle {
        position: relative;
        width: 100%;
        text-align: left;
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
        transition: all 0.3s ease;
    }

    .dropdown-toggle:hover,
    .dropdown-toggle:focus {
        background-color: #e2e8f0;
    }

    .dropdown.active .dropdown-toggle {
        background-color: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .dropdown-toggle::after {
        float: right;
        transition: transform 0.3s ease;
        font-weight: bold;
    }

    .dropdown.active .dropdown-toggle::after {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: static;
        background: transparent;
        box-shadow: none;
        padding: 0.5rem 0 0 0;
        margin-left: 1rem;
        display: none;
        border: none;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
    }

    .nav-item.active .dropdown-menu {
        display: block;
        max-height: 400px;
        opacity: 1;
    }

    .dropdown-menu a {
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.25rem;
        background-color: #f8fafc;
        border-radius: var(--border-radius);
        border: 1px solid #e2e8f0;
        font-size: 0.95rem;
        transition: all 0.2s ease;
        display: block;
        transform: translateX(0);
    }

    .dropdown-menu a:hover,
    .dropdown-menu a:focus {
        background-color: var(--primary-color);
        color: white;
        transform: translateX(5px);
    }
}

/* Improved tablet responsiveness */
@media (max-width: 1024px) and (min-width: 769px) {
    .header-content {
        padding: 0.5rem 1.5rem;
    }
    
    nav {
        gap: 1.5rem;
    }
    
    nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.95rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .header-content {
        padding: 0.5rem 0.75rem;
    }

    header h1 {
        font-size: 1.2rem;
    }

    nav {
        padding: 0.75rem;
    }

    nav a {
        padding: 0.6rem;
        font-size: 0.95rem;
    }

    .dropdown-menu a {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}
