/* =============================================== */
/* == FIX GLOBAL UNTUK BUTTON BACKGROUND == */
/* =============================================== */
/* Aturan ini mengatasi bug di mana beberapa tombol menjadi transparan.
   Ini menetapkan warna latar default, yang masih bisa ditimpa 
   oleh kelas utilitas Tailwind seperti .bg-red-500, dll. */
/* Global box-sizing for consistent layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}
button {
    background-color: #10b981; /* Default background, sama dengan emerald-600 */
    background-image: none; /* Menghapus gambar latar belakang default */
}

/* =============================================== */
/* == FIX MANUAL UNTUK .text-white == */
/* =============================================== */
/* Aturan ini memaksa warna putih untuk kelas .text-white, 
   mengatasi bug di mana ia malah menampilkan warna hitam. */
.text-white {
    color: #ffffff !important;
}

/* Menambahkan gaya dasar untuk body jika belum ada */
body {
    font-family: 'Inter', sans-serif; /* Contoh penggunaan font yang lebih modern */
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-y: auto; /* Allow vertical scrolling */
}

/* Animasi fade-in untuk section dan modal */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.animate-fade-in {
  animation: fade-in 0.7s cubic-bezier(.4,0,.2,1);
}

/* Sidebar active link (override Tailwind if needed) */
aside nav a.bg-gray-700, aside nav a.active, aside nav a[aria-current="page"] {
    background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
    color: #fff !important;
    box-shadow: 0 2px 12px 0 rgba(16,185,129,0.12);
}

aside nav a {
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.dashboard-section {
    transition: box-shadow 0.3s, border 0.3s, background 0.3s, opacity 0.3s;
}

/* Table row hover effect */
tbody tr:hover {
    background: linear-gradient(90deg, #f0fdfa 0%, #d1fae5 100%);
    box-shadow: 0 2px 8px 0 rgba(16,185,129,0.08);
    transition: background 0.2s, box-shadow 0.2s;
}

/* Modal 3D shadow */
#kantor-modal > div,
#jadwal-modal > div,
#user-modal > div,
#libur-modal > div,
#cuti-modal > div,
#import-excel-modal > div {
    box-shadow: 0 10px 40px 0 rgba(16, 185, 129, 0.18), 0 2px 8px 0 rgba(30,41,59,0.08);
    border-radius: 1.5rem;
}

@media (max-width: 768px) {
  #sidebar {
    left: -100vw;
    width: 80vw;
    transition: left 0.3s;
  }
  #sidebar.sidebar-expanded {
    left: 0;
  }
  #sidebar.sidebar-collapsed {
    left: -100vw;
  }
  #sidebar-overlay {
    display: block;
  }
}

#sidebar-overlay.hidden {
  display: none;
}

#live-badge {
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

#toast {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#toast.show {
  opacity: 1;
  pointer-events: auto;
}

.animate-fade-in {
  animation: fade-in 0.7s cubic-bezier(.4,0,.2,1);
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-slide-in {
  animation: slide-in 0.5s cubic-bezier(.4,0,.2,1);
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

header {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 12px 0 rgba(16,185,129,0.15);
  z-index: 40;
  height: 64px;
}

#navbar-clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

#navbar-profile-btn {
  background: #10b981;
  color: #fff;
  border-radius: 9999px;
  transition: background 0.2s;
}
#navbar-profile-btn:hover {
  background: #059669;
}

#navbar-profile-dropdown {
  min-width: 140px;
  box-shadow: 0 4px 24px 0 rgba(16,185,129,0.10);
  display: none;
}
.group:hover #navbar-profile-dropdown,
#navbar-profile-btn:focus + #navbar-profile-dropdown {
  display: block;
}

#navbar-profile-dropdown a {
  transition: background 0.2s;
}

.main-expanded {
  margin-top: 64px;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    height: auto !important;
    padding: 12px 16px;
  }
  #navbar-clock, #navbar-date {
    font-size: 13px;
  }
  .main-expanded {
    margin-top: 64px;
  }
}

/* Sidebar expanded and collapsed states */
.sidebar-expanded {
  width: 16rem; /* w-64 */
  transition: width 0.3s ease-in-out;
}
.sidebar-collapsed {
  width: 5rem; /* w-20 */
  transition: width 0.3s ease-in-out;
}

/* Hide text labels when sidebar is collapsed */
.sidebar-collapsed .sidebar-label {
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar-expanded .sidebar-label {
  display: inline-block;
  opacity: 1;
  transition: opacity 0.2s 0.1s;
}

/* Main content margin adjustment */
#main-content {
  margin-top: 64px;
  transition: margin-left 0.3s ease-in-out;
  min-width: 0; /* Prevent shrinking below natural size */
}
.main-expanded {
  margin-left: 16rem; /* w-64 */
}
.main-collapsed {
  margin-left: 5rem; /* w-20 */
}

/* Sidebar toggle button rotation */
.sidebar-collapsed #sidebar-toggle-desktop i {
  transform: rotate(180deg);
}
#sidebar-toggle-desktop i {
  transition: transform 0.3s;
}

/* Sidebar toggle desktop button */
.sidebar-toggle-desktop {
  position: absolute;
  top: 18px;
  right: -18px;
  z-index: 60;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: right 0.3s;
}

/* Sidebar group label */
.sidebar-group-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 1.2rem 0 0.2rem 1.5rem;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.sidebar-collapsed .sidebar-group-label { 
  display: none !important; 
}

/* Make sidebar scrollable */
#sidebar {
  overflow-y: auto;
  max-height: calc(100vh - 64px); /* Subtract header height */
}

/* Collapsible menu styles */
.menu-group-container {
  width: 100%;
  margin-bottom: 0.5rem;
}

.menu-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.menu-group-header:hover {
  background-color: rgba(16, 185, 129, 0.05);
}

.menu-group-header i {
  transition: transform 0.3s;
}

.menu-group-container.collapsed .menu-group-header i {
  transform: rotate(-90deg);
}

.collapsible-menu {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.menu-group-container.collapsed .collapsible-menu {
  max-height: 0;
}

/* =============================================== */
/* == STYLING UNTUK ACTION BUTTONS == */
/* =============================================== */
.action-button {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

/* Edit button hover */
.edit-button.action-button:hover {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 2px 5px rgba(59, 130, 246, 0.15);
}

/* Delete button hover */
.delete-button.action-button:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.15);
}

/* View button hover */
.view-proof-button.action-button:hover {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.15);
}

/* Icon styling */
.action-button i {
  font-size: 1rem;
}

/* Ripple effect on click */
.action-button::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.3s ease-out;
}

.action-button:active::after {
  transform: scale(2);
  opacity: 0;
  transition: transform 0.5s, opacity 0.3s;
}

/* =============================================== */
/* == NEW LANDING PAGE STYLES == */
/* =============================================== */

/* Top right logos */
#top-right-logos {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.top-logo {
    height: 80px;
    width: auto;
   
}

/* Grid container */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh; /* Changed from height to min-height */
}

/* Info panel (left side) */
.info-panel {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #8b5cf6 100%);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    position: relative;
    overflow: hidden;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.logo {
    width: 60px; /* Increased from 50px */
    height: auto; /* Changed from fixed height to auto */
    object-fit: contain; /* Ensure the logo maintains its aspect ratio */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.info-content {
    margin-top: 2rem;
    max-width: 500px;
    z-index: 10;
}

.info-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.info-description {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Digital clock */
.digital-clock-container {
    background: white;
    color: #1e293b;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.current-date {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.digital-clock {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0ea5e9;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

/* Server status moved to digital clock container */
.server-status {
    position: static; /* Changed from absolute */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-size: 0.875rem;
    color: #10b981;
    font-weight: 500;
}

.server-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.feature-text {
    font-weight: 500;
}

.info-footer {
    font-size: 0.875rem;
    opacity: 0.7;
    z-index: 10;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, 0.5);
    top: -200px;
    right: -200px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(14, 165, 233, 0.5);
    bottom: -150px;
    left: -150px;
}

.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 2;
}

/* Login panel (right side) */
.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    position: relative;
}

.login-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.welcome-text {
    margin-bottom: 2.5rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.welcome-subtitle {
    color: #64748b;
    font-size: 1rem;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 
        0 10px 25px rgba(14, 165, 233, 0.3),
        0 5px 10px rgba(14, 165, 233, 0.2);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 30px rgba(14, 165, 233, 0.4),
        0 8px 15px rgba(14, 165, 233, 0.3);
}

.login-btn:active {
    transform: translateY(-1px);
}

.login-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0)
    );
    transform: rotate(30deg);
    opacity: 0;
    transition: opacity 0.3s;
}

.login-btn:hover::after {
    opacity: 1;
    animation: shine 1.5s ease-out;
}

@keyframes shine {
    from {
        transform: translateX(-100%) rotate(30deg);
    }
    to {
        transform: translateX(100%) rotate(30deg);
    }
}

.help-text {
    margin-top: 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.help-link {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.help-link:hover {
    color: #0284c7;
    text-decoration: underline;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto; /* Allow scrolling within the modal overlay */
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    max-height: 90vh; /* Limit modal height */
    overflow-y: auto; /* Allow scrolling within the modal */
    margin: 20px 0; /* Add margin to ensure modal doesn't touch the edges */
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.modal-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9rem;
    text-align: left;
}

.form-input {
    width: 100%;
    /* Hapus padding di sini */
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-family: inherit;
    font-size: 1rem;
    color: #0f172a;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}


.form-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    background: white;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.input-with-icon {
    padding-left: 2.75rem; /* Tetap sama untuk ikon */
    padding-top: 0.875rem; /* Tambahkan padding atas */
    padding-bottom: 0.875rem; /* Tambahkan padding bawah */
    padding-right: 1rem; /* Tambahkan padding kanan */
}


.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: #0ea5e9;
}

.forgot-password {
    color: #0ea5e9;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #0284c7;
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.2);
}

.submit-btn:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
    padding: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.success-message {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
    padding: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: 100vh;
    }
    
    .info-panel {
        padding: 1.5rem;
    }
    
    .info-title {
        font-size: 2rem;
    }
    
    .feature-list {
        grid-template-columns: 1fr;
    }
    
    .login-panel {
        padding: 1.5rem;
    }
    
    #top-right-logos {
        top: 10px;
        right: 10px;
    }
    
    .top-logo {
        height: 40px;
    }
}

@media (max-width: 768px) {
    .info-panel {
        display: none;
    }
    
    .login-panel {
        background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #8b5cf6 100%);
        color: white;
    }
    
    .welcome-title, .welcome-subtitle {
        color: white;
    }
    
    .help-text {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .help-link {
        color: white;
        text-decoration: underline;
    }
    
    .server-status {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
        color: white;
    }
    
    .server-dot {
        background: white;
    }
    
    #top-right-logos {
        top: 10px;
        right: 10px;
    }
    
    .top-logo {
        height: 35px;
    }
}
