/* style-header */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #225581;
    --primary-dark: #14435e;
    --accent-color: #81dd36;
    --text-light: #FFFFFF;
    --text-dark: #333333;
    --bg-light: #F7F7F7;
    --bg-lighter: #FFFFFF;
    --border-light: #E0E0E0;
}

/* Mobile-first approach - Base styles for mobile */
header.header-component {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2); 
    top: 0;
    position: relative;
}

.header-component .logo img {
    width: 100px;
    height: auto;
    filter: drop-shadow(10px 10px 3px rgba(0, 0, 0, 0.2));
    padding: 4px;
    transition: all 0.3s ease;
}

/* Hamburger menu styles */
.header-component .hamburger {
    display: block;
    cursor: pointer;
    z-index: 1001;
    margin-left: auto;
    margin-right: 15px;
}

.header-component .hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-light);
    transition: all 0.3s ease-in-out;
}

.header-component .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.header-component .hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.header-component .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Navigation menu - mobile first */
.header-component nav {
    position: fixed;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--primary-dark);
    padding-top: 70px;
    transition: 0.3s;
    z-index: 1000;
    overflow-y: auto;
}

.header-component nav.active {
    left: 0;
}

body.menu-open {
    overflow: hidden;
}

.header-component nav ul {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-component nav ul li {
    margin: 15px 0;
    text-align: center;
}

.header-component nav ul li a {
    display: block;
    padding: 10px;
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.header-component nav ul li a:hover, 
.header-component nav ul li a.active {
    background-color: var(--accent-color);
    color: var(--primary-dark);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Dropdown styles for mobile */
.header-component .dropdown-content {
    display: none;
    background-color: rgba(15, 79, 115, 0.9);
    width: 100%;
    max-height: none;
    overflow-y: visible;
    position: static;
    box-shadow: none;
    border-radius: 5px;
    margin-top: 5px;
}

.header-component .dropdown.open .dropdown-content {
    display: block;
}

.header-component .columna {
    float: none;
    width: 100%;
}

.header-component .dropdown-content a {
    padding: 10px;
    text-align: center;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.header-component .dropdown-content a:hover {
    background-color: var(--accent-color);
    color: var(--primary-dark);
}

/* Login form for mobile */
.header-component .login-form {
    width: 100%;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 5px;
}

/* Add styles for logged-in user display */
.header-component .login-form p {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    font-size: 14px;
    color: var(--text-light) !important;
    text-align: center;
}

.header-component .login-form p button {
    margin-top: 8px;
    width: 100%;
    max-width: 150px;
}

.header-component .login-form nav {
    position: static;
    width: 100%;
    height: auto;
    background-color: transparent;
    padding: 0;
    margin-top: 5px;
}

.header-component .login-form nav ul {
    display: flex;
    justify-content: center;
}

.header-component .login-form nav ul li {
    margin: 0;
}

.header-component .login-form nav ul li a {
    background-color: var(--accent-color);
    color: var(--primary-dark);
    font-weight: bold;
    padding: 8px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.header-component .login-form nav ul li a:hover {
    background-color: #5ea127;
    transform: translateY(-2px);
}

.header-component .login-form form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Error message styling */
.header-component .error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 14px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Adjust the input-group to better align elements */
.header-component .login-form .input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

/* Make sure inputs are properly sized */
.header-component .login-form input[type="text"],
.header-component .login-form input[type="password"] {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* Ensure button is properly aligned */
.header-component .login-form button {
    margin-top: 5px;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .header-component .error-message {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* Adding space between username and password inputs */
.header-component .login-form input[type="text"] {
    margin-bottom: 10px;
}

.header-component .login-form button {
    background-color: var(--accent-color);
    color: var(--primary-dark);
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin-top: 10px;
}

.header-component .login-form button:hover {
    background-color: #5ea127;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.header-component .notificaciones {
    text-align: center;
    margin-top: 10px;
    color: var(--text-light);
}

/* Medium screens */
@media screen and (min-width: 730px) {
    .header-component .hamburger {
        display: none;
    }
    
    header.header-component {
        flex-wrap: nowrap;
        padding: 15px 30px;
    }
    
    .header-component .logo img {
        width: 120px;
        margin-right: 20px;
    }
    
    .header-component nav {
        position: static;
        width: auto;
        height: auto;
        padding-top: 0;
        background-color: transparent;
        overflow-y: visible;
    }
    
    .header-component nav ul {
        display: flex;
        flex-wrap: wrap;
    }
    
    .header-component nav ul li {
        margin: 0 5px;
        text-align: left;
    }
    
    .header-component nav ul li a {
        padding: 8px 15px;
        background-color: transparent;
    }
    
    /* Dropdown styles for medium screens */
    .header-component .dropdown {
        position: relative;
    }
    
    .header-component .dropdown-content {
        position: absolute;
        display: none;
        background-color: var(--primary-dark);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        z-index: 1500;
        width: 400px;
        max-height: 400px;
        overflow-y: auto;
        border-radius: 5px;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .header-component .columna {
        float: left;
        width: 50%;
    }
    
    .header-component .dropdown.show-dropdown .dropdown-content {
        display: block;
        animation: fadeIn 0.3s ease;
    }
    
    @media screen and (min-width: 768px) {
        .header-component .dropdown:hover .dropdown-content {
            display: block;
            animation: fadeIn 0.3s ease;
        }
    }
    
    @keyframes fadeIn {
        from { 
            opacity: 0; 
            transform: translateX(-50%) translateY(-10px); 
        }
        to { 
            opacity: 1; 
            transform: translateX(-50%) translateY(0); 
        }
    }
    
    /* Login form for medium screens */
    .header-component .login-form {
        width: auto;
        margin-left: auto;
        flex-direction: row;
        align-items: center;
        background-color: transparent;
        padding: 0;
    }
    
    .header-component .login-form form {
        flex-direction: row;
        align-items: center;
    }
    
    /* Revised logged-in user display for medium screens - vertical layout */
    .header-component .login-form p {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-color: rgba(255, 255, 255, 0.1);
        padding: 10px;
        margin-bottom: 0;
        text-align: center;
        border-radius: 5px;
    }
    
    .header-component .login-form p button {
        margin-top: 8px;
        margin-left: 0;
        width: 100%;
    }
    
    .header-component .login-form nav {
        margin-top: 8px;
        margin-left: 0px;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .header-component .login-form nav ul {
        flex-direction: column;
        width: 100%;
        max-width: 180px;
    }
    
    .header-component .login-form nav ul li {
        margin: 0 0 5px 0;
        width: 100%;
    }
    
    .header-component .login-form nav ul li a {
        padding: 6px 12px;
        display: block;
        text-align: center;
        width: 100%;
    }
    
    .header-component .login-form input[type="text"],
    .header-component .login-form input[type="password"] {
        margin: 0 5px;
        width: auto;
    }
    
    .header-component .login-form button {
        margin: 0 5px;
    }
}

/* Large screens */
@media screen and (min-width: 992px) {
    header.header-component {
        padding: 20px 50px;
    }
    
    .header-component .dropdown-content {
        width: 500px;
    }
    
    .header-component nav ul li {
        margin-left: 8px;
    }
    
    .header-component .logo img {
        width: 140px;
    }
    
    /* Enhance logged-in user display for large screens - keep vertical layout */
    .header-component .login-form p {
        font-size: 15px;
        min-width: 180px;
    }
    
    /* Add more space between user info and private zone button */
    .header-component .login-form nav {
        margin-top: 12px;
        margin-left: 10px;
    }
    
    .header-component .login-form nav ul li a {
        padding: 8px 15px;
    }
    
    .header-component .login-form input[type="text"],
    .header-component .login-form input[type="password"] {
        margin: 5px;
    }
}

/* Medium screens but smaller than large screens */
@media screen and (min-width: 730px) and (max-width: 991px) {
    /* Change login form to column layout */
    .header-component .login-form form {
        flex-direction: column;
    }
    
    .header-component .login-form input[type="text"],
    .header-component .login-form input[type="password"] {
        margin: 5px 0;
    }
    
    .header-component .login-form input[type="text"] {
        margin-bottom: 10px;
    }
    
    .header-component .login-form button {
        margin-top: 10px;
    }
    
    /* Adjust logged-in user display for medium-small screens - keep vertical layout */
    .header-component .login-form p {
        font-size: 14px;
        min-width: 160px;
    }
    
    .header-component .login-form p button {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .header-component .login-form nav ul li a {
        padding: 5px 10px;
        font-size: 13px;
    }
}

/* Mobile-specific fixes for the private zone button */
@media screen and (max-width: 729px) {
    /* Fix for the private zone button in mobile view */
    .header-component .login-form nav {
        position: static;
        width: 100%;
        height: auto;
        background-color: transparent;
        padding: 0;
        margin-top: 10px;
        z-index: 999;
    }
    
    .header-component .login-form nav ul li a {
        display: inline-block;
        width: auto;
        min-width: 120px;
    }
    
    /* Ensure the private zone section doesn't interfere with the mobile menu */
    header.header-component {
        position: relative;
        overflow: visible;
    }
}
