/* General Body and HTML Styling (Optimalisasi Tata Letak Global + Warna Lama) */
html {
    overflow-x: hidden; 
}

body {
    /* Background dan Centering */
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%);
    background-image: url('rsukm.jpg');
    background-size: cover; 
    background-position: center center; 
    background-repeat: no-repeat; 
    background-attachment: fixed;
    position: relative;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center; /* Memastikan konten di tengah horizontal */
    align-items: center; /* Memastikan konten di tengah vertikal */
    flex-direction: column;  
    padding: 30px 0;
    margin: 0;
}

/* Overlay untuk Keterbacaan */
body::before {
    content: "";
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); 
    z-index: -1;
}

/* Main Container Styling (Optimasi Ukuran dan Simetri) */
.container {
    background-color: rgba(255, 255, 255, 0.98);
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    min-height: 80vh; 
    margin: 30px auto; 
}

/* Header Styling (Warna Hijau RSU) */
.header {
    background-color: #4caf50; /* Hijau Utama */
    color: white;
    padding: 30px 30px 20px 30px; 
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    text-align: center;
}

.header-title {
    margin: 0;
    font-size: 1.8em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.header-subtitle {
    margin: 5px 0 0;
    font-size: 1em;
    opacity: 0.8;
}

/* Main Content Area */
.main-content {
    flex-grow: 1; /* Konten mengisi ruang yang tersedia */
    padding: 30px;
    display: flex;
    flex-direction: column;
}

/* Card Styling untuk Konten */
.content-card {
    background-color: #ffffff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
}

.page-title {
    color: #388e3c; /* Hijau Sedang */
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Breadcrumb Styling */
.breadcrumb-container {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #757575;
}

.breadcrumb-item {
    color: #4caf50;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #388e3c;
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 5px;
    color: #bdbdbd;
}

/* Menu Button Styling (CSS Grid untuk Responsif) */
.flex-menu-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px;
    margin-top: 20px;
}

.menu-button {
    /* WARNA UTAMA UNTUK SEMUA TOMBOL */
    width: 100%;
    padding: 25px 15px;
    border: none;
    border-radius: 8px;
    background-color: #09d12aee; /* Hijau Muda Seragam */
    color: #ffffff; /* Teks hijau tua Seragam */
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.menu-button:hover {
    background-color: #66bb6a; /* Hijau agak tua saat hover Seragam */
    transform: translateY(-2px);
    box-shadow: 0 0px 12px rgba(0, 0, 0, 0.2);
}

.menu-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Styling Khusus untuk Tombol Download DIBUANG agar sama dengan .menu-button */
/* class .menu-button-download tetap ada di HTML tapi stylingnya ditiadakan */

/* Back Button Styling */
.back-button {
    background: none;
    border: 1px solid #9e9e9e;
    color: #616161;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.9em;
    display: inline-block;
}

.back-button:hover {
    background-color: #f5f5f5;
    color: #424242;
}

/* Footer Styling (Menampilkan NIP) */
.footer {
    display: flex;
    justify-content: space-between; /* Untuk meratakan elemen */
    align-items: center;
    padding: 15px 30px;
    background-color: #2e7d32; /* Hijau tua */
    color: white;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    font-size: 14px;
    margin-top: auto; /* Memastikan footer selalu di bawah */
}

/* Styling untuk teks NIP */
.user-info-text {
    margin: 0;
    font-weight: bold;
    color: #c8e6c9; /* Warna hijau muda untuk kontras */
}

.logout-link {
    color: #ffccbc;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.logout-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Placeholder/Error Text */
.placeholder-error {
    text-align: center;
    color: #D32F2F;
    font-weight: bold;
    padding: 20px;
    border: 1px dashed #D32F2F;
    border-radius: 5px;
    margin-top: 20px;
}

/* ======================================= */
/* LOGIN CARD STYLING */
/* ======================================= */

.login-card {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 1s ease-out;
    margin: auto; /* Memastikan di tengah halaman */
}

.login-card h2 {
    color: #388e3c;
    margin-bottom: 25px;
    font-size: 1.5em;
}

.login-card input[type="text"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Penting untuk padding */
    font-size: 1em;
}

.login-card button {
    width: 100%;
    background-color: #4caf50;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

.login-card button:hover {
    background-color: #388e3c;
    transform: translateY(-1px);
}

.login-card button:active {
    transform: translateY(0);
}

#loginMessage {
    margin-top: 15px;
    font-weight: bold;
}

/* ======================================= */
/* ANIMASI */
/* ======================================= */

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

.content-card {
    animation: fadeIn 0.5s ease-out;
}


/* ======================================= */
/* MEDIA QUERIES UNTUK TAMPILAN SMARTPHONE */
/* ======================================= */
@media (max-width: 600px) {
    body {
        background-attachment: scroll; 
        padding: 0;
    }
    
    .container {
        padding: 0; 
        width: 100%;
        max-width: none;
        border-radius: 0; 
        box-shadow: none; 
        margin: 0;
        min-height: 100vh;
    }

    .login-card {
        width: 95%; 
        padding: 30px 20px; 
        margin: 10px auto; 
    }
    
    .header {
        padding: 20px 15px 10px 15px; 
        border-radius: 0;
    }

    .content-card {
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
        margin-top: 0; 
    }

    .footer {
        flex-direction: column;
        padding: 10px 15px;
        text-align: center;
        border-radius: 0;
    }
    
    .footer p {
        margin: 5px 0;
    }

    .user-info-text {
        order: -1; /* Pindahkan NIP ke atas jika perlu */
    }
    
    .flex-menu-container {
        grid-template-columns: 1fr; /* 1 kolom di HP */
    }
    
    .menu-button {
        padding: 18px 10px;
        font-size: 1em;
    }
    /* ------------------------------------------------ */
/* 1. Tombol Chat Mengambang (floating-chat-button) */
/* ------------------------------------------------ */
#floating-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #90EE90; /* Hijau Muda */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: background-color 0.3s, transform 0.3s;
}

#floating-chat-button:hover {
    background-color: #7CFC00;
    transform: scale(1.08); /* Efek membesar saat disentuh */
}

#chat-icon {
    font-size: 24px;
    color: #333;
    line-height: 1;
}

/* Indikator Online */
#online-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background-color: #3CB371; /* Hijau Online */
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 1.5s infinite; /* Efek berdenyut */
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(60, 179, 113, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(60, 179, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(60, 179, 113, 0); }
}

/* ------------------------------------------------ */
/* 2. Styling Kotak Chat (chat-box) */
/* ------------------------------------------------ */
#chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    max-height: 420px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none; /* Awalnya tersembunyi */
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

#chat-box.open {
    display: flex;
}

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

#chat-header {
    background-color: #90EE90; /* Hijau Muda */
    color: #333;
    padding: 12px 15px;
    font-weight: bold;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

#close-chat {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

#close-chat:hover {
    color: #D32F2F; /* Merah sedikit gelap */
}

#chat-body {
    padding: 15px;
    flex-grow: 1;
}

#chat-input {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s;
}

#chat-input:focus {
    border-color: #7CFC00; /* Hijau saat fokus */
    outline: none;
}

#chat-footer {
    padding: 10px 15px;
    background-color: #f7f7f7;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    text-align: right;
}

#send-button {
    background-color: #25D366; /* Hijau WhatsApp */
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    transition: background-color 0.3s, transform 0.1s;
}

#send-button:hover {
    background-color: #1DA851;
}

/* Media Query untuk Responsif (Mobile) */
@media (max-width: 500px) {
    #chat-box {
        bottom: 80px;
        right: 10px;
        width: 90vw;
        max-width: 380px;
        max-height: 75vh;
    }
    #floating-chat-button {
        bottom: 10px;
        right: 10px;
        width: 55px;
        height: 55px;
    }
}
}
