/* ================================================================
   HEADER STYLES - e-Monitoring Irigasi
   ================================================================ */

/* ===== HEADER CONTAINER ===== */
.main-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
}

/* ===== LOGO SECTION ===== */
.logo-section {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.logo-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.logo-text h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: white;
}

.logo-text p {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

/* ===== MOBILE MENU TOGGLE ===== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== NAVIGATION ===== */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
}

/* ===== DROPDOWN MENU ===== */
.has-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 0.65rem;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: #f8f9fa;
    padding-left: 24px;
}

.dropdown-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* ===== USER MENU ===== */
.user-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
    padding-left: 16px;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
}

.user-icon {
    font-size: 1.2rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.logout-icon {
    font-size: 1rem;
}

.btn-login {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    padding: 8px 20px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-login:hover {
    background: white;
    color: #3498db;
}

.btn-register {
    background: #2ecc71;
    padding: 8px 20px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-register:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    min-height: calc(100vh - 70px);
    background: #f5f7fa;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ================================================================
   RESPONSIVE DESIGN
   ================================================================ */

/* Tablet */
@media (max-width: 992px) {
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text p {
        font-size: 0.7rem;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .user-name {
        font-size: 0.85rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        padding: 10px 15px;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 3;
    }
    
    .main-navigation {
        width: 100%;
        order: 4;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        background: #34495e;
        border-radius: 10px;
        margin-top: 15px;
        padding: 10px 0;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }
    
    .main-navigation.active .nav-menu {
        display: flex;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        padding: 14px 20px;
        border-radius: 0;
        justify-content: flex-start;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    /* Dropdown Mobile */
    .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        margin: 0;
        padding: 0;
        border-radius: 0;
    }
    
    .has-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .has-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    
    .dropdown-arrow {
        margin-left: auto;
    }
    
    .dropdown-item {
        padding-left: 50px;
    }
    
    .dropdown-item:hover {
        padding-left: 54px;
    }
    
    /* User Menu Mobile */
    .user-nav {
        flex-direction: column;
        width: 100%;
        border: none;
        margin: 0;
        padding: 15px 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        gap: 10px;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-logout {
        width: 100%;
        justify-content: center;
    }
    
    /* Logo Mobile */
    .logo-icon {
        font-size: 1.6rem;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text p {
        font-size: 0.65rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo-text p {
        display: none;
    }
    
    .user-role {
        display: none;
    }
}

/* Prevent body scroll when mobile menu open */
body.menu-open {
    overflow: hidden;
}