* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header dengan Glassmorphism - DIHAPUS */
header {
    display: none;
}

/* Main */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
}

/* Slider dengan efek glassmorphism */
.slider-container {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    z-index: -1;
}

.slider-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.slider-container .slide {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
    background-size: cover;
    background-position: center;
}

.slider-container .slide.active { 
    opacity: 1; 
}

/* Hero Content (Text) */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
    width: 80%;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.7);
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.hero-content p {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

/* Login Trigger Button (Center) */
.login-trigger-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    background: transparent;
    border: 2px solid #ffffff;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
}

.login-trigger-btn:hover {
    background: #ffffff;
    color: #333;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Removed Login Floating Action Button */
.login-fab {
    display: none;
}

/* Login Form dengan Glassmorphism */
.login-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%; 
    max-width: 400px;
    position: fixed; /* Changed to fixed for modal behavior */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.login-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-close:hover {
    transform: rotate(90deg);
    color: #e74c3c;
}

.login-header { 
    text-align: center; 
    margin-bottom: 20px; 
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(14, 14, 14, 0.5);
}

.login-header h2 { 
    color: #ffffff; 
    font-weight: 600;
    margin-bottom: 10px;
}

.login-header p {
    color: #f4f5f7;
    opacity: 0.9;
}

.form-group { 
    margin-bottom: 20px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    color: #ffffff;
    font-weight: 500;
}

.form-group input {
    width: 100%; 
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.9); /* More opaque for better readability */
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px; /* Slightly more rounded */
    color: #2c3e50;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.form-group input:focus {
    outline: none;
    background: #ffffff;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    padding-right: 45px;
}

#togglePassword {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #7f8c8d;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 2;
}

#togglePassword:hover {
    color: #3498db;
}

.form-group input::placeholder {
    color: rgba(44, 62, 80, 0.7);
}

.btn {
    width: 100%; 
    padding: 14px;
    background: rgba(52, 152, 219, 0.8);
    backdrop-filter: blur(5px);
    color: white; 
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 1rem; 
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn:hover { 
    background: rgba(41, 128, 185, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 8px 0;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 5px;
}

/* Show class for click toggle */
.dropdown-content.show {
    display: block;
    animation: fadeIn 0.3s;
}

/* Hover fallback (optional, can be removed if click-only is preferred) */
.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s;
}

/* Bridge to fix hover gap */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    color: #ecf0f1;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #3498db;
}

/* Background Manager Styles */
.bg-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.bg-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 10px;
}

.bg-item:last-child {
    border-bottom: none;
}

.bg-preview {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bg-info {
    flex: 1;
}

.bg-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: #fff;
}

.bg-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #bdc3c7;
}

.bg-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.add-bg-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.add-bg-form h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #3498db;
}


.message { 
    margin-top: 15px; 
    padding: 12px; 
    display: none; 
    text-align: center; 
    border-radius: 10px; 
    backdrop-filter: blur(5px);
    font-weight: 500;
}

.message.error { 
    background: rgba(231, 76, 60, 0.2); 
    color: #c0392b; 
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.message.success { 
    background: rgba(46, 204, 113, 0.2); 
    color: #27ae60; 
    border: 1px solid rgba(46, 204, 113, 0.3);
}

/* WebGIS Page */
#webgis-page { 
    display: none; 
    width: 100%; 
    height: 100vh;
    flex-direction: column; 
    background: rgba(255, 255, 255, 0.05);
}

#webgis-page.active {
    display: flex;
}

.webgis-header {
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #ecf0f1;
    padding: 10px 20px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    min-height: 60px;
    z-index: 500; /* Ensure header is above map */
}

.user-info {
    display: flex;
    align-items: center;
    margin-right: 20px;
    flex: 1;
    min-width: 200px;
    color: #ecf0f1;
}

.user-info i {
    margin-right: 8px;
    color: #3498db;
}

.user-info strong {
    color: #f1c40f;
}

/* Menu Bar - Desktop */
.menu-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ecf0f1;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    order: -1;
    margin-right: auto;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ecf0f1;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Dialog Overlay */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.dialog-overlay.active {
    display: flex;
}

/* Dialog Box dengan Glassmorphism */
.dialog-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    animation: dialogAppear 0.3s ease-out;
    color: #ffffff;
}

@keyframes dialogAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.dialog-header h2 {
    color: #ffffff;
    font-weight: 600;
    margin: 0;
}

.dialog-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #2c3e50;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.dialog-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.dialog-content {
    line-height: 1.6;
    margin-bottom: 25px;
}

.dialog-content p {
    margin-bottom: 15px;
    color: #ffffff;
}

.dialog-content strong {
    color: #ffffff;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dialog-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.dialog-btn-primary {
    background: rgba(52, 152, 219, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dialog-btn-primary:hover {
    background: rgba(41, 128, 185, 0.9);
    transform: translateY(-2px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
}

/* Mobile Menu Content */
.mobile-menu-content {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu-content.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: #ecf0f1;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-btn-item {
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ecf0f1;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mobile-menu-btn-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.logout-btn {
    background: rgba(231, 76, 60, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white; 
    padding: 8px 15px;
    border-radius: 10px; 
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover { 
    background: rgba(192, 57, 43, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.map-frame { 
    width: 100%; 
    flex: 1; 
    border: none; 
    background: rgba(255, 255, 255, 0.05);
    height: calc(100vh - 60px);
}

/* Footer marquee dengan Glassmorphism */
.footer-marquee {
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(10px);
    color: #ecf0f1;
    overflow: hidden; 
    white-space: nowrap;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 100;
}

.footer-marquee .marquee {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 60s linear infinite;
}

.footer-marquee:hover .marquee { 
    animation-play-state: paused; 
}

.footer-marquee p { 
    display: inline; 
    padding: 0 2rem; 
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .webgis-header {
        padding: 8px 15px;
        gap: 10px;
    }
    
    .user-info {
        min-width: auto;
        margin-right: 10px;
        font-size: 0.9rem;
        order: 2;
        flex: 1;
        justify-content: center;
    }
    
    /* Sembunyikan menu desktop, tampilkan menu mobile */
    .menu-bar {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
        order: 1;
        margin-right: 10px;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
        order: 3;
        margin-left: auto;
    }
    
    /* Adjust header layout untuk mobile */
    .webgis-header {
        justify-content: space-between;
    }
    
    .login-container {
        padding: 25px;
    }
    
    .map-frame {
        height: calc(100vh - 50px);
    }
    
    .dialog-box {
        padding: 25px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .user-info {
        font-size: 0.8rem;
    }
    
    .user-info span {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .webgis-header {
        padding: 6px 10px;
        min-height: 50px;
    }
    
    .mobile-menu-content {
        width: 85%;
    }
    
    .mobile-menu-btn {
        padding: 6px 10px;
        font-size: 1rem;
    }
    
    .logout-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .login-container {
        padding: 20px;
    }
    
    .map-frame {
        height: calc(100vh - 45px);
    }
    
    .dialog-box {
        padding: 20px;
        margin: 15px;
    }
    
    .dialog-header h2 {
        font-size: 1.3rem;
    }
}