/* auth.css */

/* Auth Container */
.auth-container {
    display: flex; /* Keep flex for internal layout (centering cards) */
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* This is fine, but height: 100% is more explicit for absolute positioning */
    background-color: #f4f6f9;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    position: absolute; /* Position absolutely within body */
    top: 0;
    left: 0;
    height: 100%; /* Ensure it takes full height of its relative parent (body) */
    /* transition: opacity 0.3s ease; */ /* Optional: for fading between views */
}

.auth-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

/* Updated styles for the logo */
.auth-header .logo {
    max-width: 120px; /* Max width for desktop/tablet */
    height: auto; /* Maintain aspect ratio */
    margin-bottom: 20px; /* Increased margin for better spacing */
    object-fit: contain; /* Ensure the entire image is visible within its bounds */
}

.auth-header h3 {
    margin: 0;
    font-size: 22px; /* Default size for h3 in auth header */
    color: #2c3e50;
}

.auth-card p {
    font-size: 14px; /* Default size for auth card paragraph */
    color: #555;
    margin-bottom: 20px;
}

/* Input Group (reusing from style.css but with specific overrides) */
.auth-card .input-group {
    margin-bottom: 15px;
    text-align: left;
}

.auth-card label {
    font-size: 14px; /* Default size for auth card label */
    font-weight: 600;
    margin-bottom: 8px;
    color: #34495e;
    display: block;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.modal-content input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px; /* Default size for auth card input */
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.modal-content input[type="email"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Auth Button */
.auth-button {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px; /* Default size for auth button */
    font-weight: bold;
    color: #fff;
    background: linear-gradient(45deg, #e84393, #d63031);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 67, 147, 0.4);
    margin-top: 15px;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(232, 67, 147, 0.5);
}

/* Grup Tombol Login & Lupa Password */
.auth-button-group {
    display: flex;
    gap: 15px; /* Jarak di antara tombol kiri dan kanan */
    margin-top: 15px; /* Jarak dari kolom password di atasnya */
    width: 100%;
}

.auth-button-group .auth-button {
    margin-top: 0; /* Menghapus margin bawaan tombol agar posisinya lurus */
    flex: 1; /* Membuat kedua tombol membagi ruang 50% - 50% dengan adil */
    padding: 12px 10px; /* Menyesuaikan padding agar pas */
    font-size: 15px; /* Menyesuaikan ukuran font */
}

.auth-button.secondary-button {
    background: #6c757d; /* Grey color for secondary action */
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.auth-button.secondary-button:hover {
    background: #5a6268;
    box-shadow: 0 6px 18px rgba(108, 117, 125, 0.5);
}

.auth-link {
    display: block;
    margin-top: 15px;
    font-size: 13px;
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #217dbb;
    text-decoration: underline;
}

/* Logout Button (general style, used by new modal button) */
.btn-logout {
    background-color: #e74c3c; /* Red color */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px; /* Default size for logout button */
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* Mobile Logout Button (in header) - now specific to mobileLogoutIcon */
.main-header .mobile-logout-icon {
    background-color: transparent;
    border: none;
    color: #ecf0f1;
    font-size: 28px; /* Default size for mobile logout icon */
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
    /* Positioning for top-right corner */
    position: absolute; /* Penting: agar bisa menggunakan top/right */
    top: 50%; /* Posisikan vertikal di tengah header */
    right: 15px; /* Jarak dari kanan */
    transform: translateY(-50%); /* Sesuaikan posisi vertikal agar benar-benar di tengah */
}

.main-header .mobile-logout-icon:hover {
    color: #e84393;
}


/* New styles for sidebar logout icon (desktop) */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px; /* Keep original padding */
    margin-bottom: 30px; /* Keep original margin */
}

.sidebar-logout-icon {
    background: none;
    border: none;
    color: #bdc3c7; /* Warna ikon seperti tab-button non-aktif */
    font-size: 36px; /* Default size for sidebar logout icon */
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
}

.sidebar-logout-icon:hover {
    color: #e84393; /* Warna hover seperti credit text */
}

.sidebar-header .title-group {
    flex-grow: 1; /* Biarkan title-group mengambil sisa ruang */
    text-align: left; /* Pastikan teks rata kiri */
}

.sidebar-header .title-group h3 {
    font-size: 18px; /* Default size for h3 in sidebar header */
    margin: 0;
    color: #ecf0f1; /* Warna teks putih */
}

/* Adjustments for mobile header to accommodate user name */
.main-header {
    display: flex;
    justify-content: space-between; /* Rata kiri dan kanan */
    align-items: center;
    padding: 15px 25px; /* Padding ini akan menjadi batas untuk absolute positioning */
    background-color: #2c3e50;
    color: #ecf0f1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    position: fixed; /* Penting: untuk konteks absolute positioning children */
    top: 0;
    left: 0;
    z-index: 100;
}

.main-header .title-group {
    flex-grow: 1;
    text-align: left; /* Pastikan teks rata kiri */
    margin-right: 15px; /* Beri sedikit ruang dari tombol logout */
}

.main-header .title-group h3 {
    margin: 0;
    font-size: 18px; /* Default size for h3 in mobile header */
    font-weight: 600;
    color: #ecf0f1;
}

.main-header .credit {
    font-size: 12px; /* Default size for credit in mobile header */
    color: #e84393;
    font-weight: bold;
    margin: 0;
}

/* --- Modal Styles (Custom Alert & Logout Confirmation) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    /* Default to hidden */
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Pastikan ini sangat tinggi */
    opacity: 0; /* Untuk transisi fade-in */
    visibility: hidden; /* Untuk transisi fade-in */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.active {
    display: flex !important; /* <-- Lebih agresif di sini */
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    transform: translateY(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000; /* Pastikan ini lebih tinggi dari backdrop */
}

.modal-backdrop.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    background: linear-gradient(45deg, #e84393, #d63031);
    color: white;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.modal-title {
    font-size: 18px; /* Default size for modal title */
    font-weight: 700;
    margin: 0;
}

.modal-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: transform 0.2s ease;
}

.modal-close-button:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    font-size: 14px; /* Default size for modal body text */
    color: #34495e;
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #ecf0f1;
    text-align: right;
    background-color: #f9f9f9;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    display: flex; /* Use flexbox for buttons */
    justify-content: flex-end; /* Align buttons to the right */
    gap: 10px; /* Space between buttons */
}

.modal-ok-button {
    background-color: #2ecc71; /* Green color for OK */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 15px; /* Default size for modal buttons */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.modal-ok-button:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
}

.modal-cancel-button {
    background-color: #e84393; /* Grey color for Cancel */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 15px; /* Default size for modal buttons */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.modal-cancel-button:hover {
    background-color: #d63031;
    transform: translateY(-1px);
}

/* New styles for temporary password display */
.temp-password-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    padding: 8px 12px;
    background-color: #e9ecef; /* Light grey background */
    margin-top: 10px;
}

.temp-password-display {
    flex-grow: 1;
    font-family: monospace; /* Monospace font for password */
    font-size: 16px;
    color: #495057;
    text-align: left;
    padding-right: 10px;
    overflow-wrap: break-word; /* Ensure long passwords wrap */
}

.copy-button {
    background-color: #007bff; /* Blue color */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.copy-button:hover {
    background-color: #0056b3;
}

.temp-password-info {
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
    text-align: center;
}


/* The .hidden class should always override other display properties */
.hidden {
    display: none !important;
}

/* Responsive adjustments for modal */
@media (max-width: 767px) {
    .modal-content {
        width: 95%;
        margin: 0 10px;
    }
    .modal-footer {
        flex-direction: column; /* Stack buttons vertically on small screens */
        gap: 8px;
    }
    .modal-ok-button, .modal-cancel-button {
        width: 100%; /* Full width buttons */
        margin-left: 0; /* Remove left margin */
    }

    /* Mobile specific styles for the logo */
    .auth-header .logo {
        max-width: 80px; /* Smaller on mobile */
        margin-bottom: 15px; /* Slightly less margin */
    }
}

/* Tablet View (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .auth-header .logo {
        max-width: 100px; /* Medium size on tablet */
        margin-bottom: 18px;
    }
}

/* Style untuk User Detail Popup (BARU) */
.user-detail-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 30px;
    padding-bottom: 30px;
}

.user-detail-icon {
    font-size: 60px;
    color: #34495e;
    margin-bottom: 15px;
}

.user-detail-body h4 {
    font-size: 20px;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.user-detail-body p {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
}

.user-detail-footer {
    justify-content: space-between; /* Membuat tombol terpisah */
}