/* assets/css/theme.css */
@import url('variables.css');
@import url('components.css');
@import url('layout.css');

/* Additional global styles can go here */

/* ====== GLOBAL PAGE HEADER ====== */

.page-header {
    background: linear-gradient(135deg, var(--primary-color, #2c3e50), var(--secondary-color, #3498db));
    color: #fff;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 16px 16px;
}

/* Biar semua teks di header putih, tidak perlu text-primary/text-muted lagi */
.page-header h1,
.page-header h2,
.page-header h3,
.page-header p {
    color: #fff !important;
    margin-bottom: 0;
}

/* Tombol di sisi kanan header */
.page-header .btn-header {
    border-radius: 999px;
    font-weight: 500;
}

/* Untuk jarak kecil di bawah judul kalau butuh subtitle */
.page-header-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}




/* Custom styles for Backup Page */
.btn-backup {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-backup:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Table responsive improvements */
.table-responsive table {
    min-width: 800px;
}

/* Badge improvements */
.badge {
    font-size: 0.75em;
}

/* Card header improvements */
.card-header {
    font-weight: 600;
}

/* Breadcrumb improvements */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Backup button grid layout */
.backup-grid .btn {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.backup-grid .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Text truncate for long file names */
.text-truncate-custom {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status badges */
.status-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}


/* Kiosk Specific Styles */
.kiosk-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.kiosk-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.kiosk-header {
    border-radius: 1rem 1rem 0 0 !important;
    font-weight: 700;
}

.kiosk-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.kiosk-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.kiosk-input {
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 0.75rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.kiosk-input:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* Animation for scan icon */
.scan-animation {
    animation: scanPulse 2s infinite;
}

@keyframes scanPulse {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Success state */
.success-state {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

/* Responsive kiosk adjustments */
@media (max-width: 576px) {
    .kiosk-container {
        padding: 1rem;
    }
    
    .kiosk-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .kiosk-input {
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* Print styles for kiosk receipts */
@media print {
    .no-print {
        display: none !important;
    }
    
    .kiosk-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}


/* Dashboard Statistik Styles */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
    transition: transform 0.2s ease;
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-info:hover,
.card.bg-warning:hover {
    transform: translateY(-5px);
}

.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-info .card-body,
.card.bg-warning .card-body {
    padding: 2rem 1rem;
}

/* Progress bar improvements */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Table improvements */
.table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
}

.table-responsive table {
    min-width: 600px;
}

/* Badge improvements */
.badge {
    font-size: 0.75em;
    padding: 0.4em 0.6em;
}

/* Card header improvements */
.card-header {
    font-weight: 600;
}

/* Breadcrumb improvements */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
}

/* Quick actions button styles */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        margin-bottom: 0.5rem;
    }
    
    .col-md-3 .card .card-body {
        padding: 1.5rem 0.5rem;
    }
}

/* Filter form styles */
.form-label {
    font-weight: 600;
    color: #495057;
}

/* Animation for real-time updates */
@keyframes highlightUpdate {
    0% { background-color: #d4edda; }
    100% { background-color: transparent; }
}

.highlight-update {
    animation: highlightUpdate 2s ease;
}


/* Logo Styling */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.university-logo {
    max-height: 80px;
    max-width: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(0); /* Untuk logo hitam */
    transition: transform 0.3s ease;
}

.university-logo:hover {
    transform: scale(1.05);
}

/* Fallback logo jika file tidak ada */
.logo-fallback {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.login-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.university-badge {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.5rem;
    border: 2px solid #bdc3c7;
    border-radius: 25px;
    display: inline-block;
    background: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-container {
        height: 80px;
        margin-bottom: 1rem;
    }
    
    .university-logo {
        max-height: 60px;
        max-width: 150px;
    }
    
    .login-header h1 {
        font-size: 1.8rem;
    }
    
    .university-badge {
        font-size: 1rem;
        padding: 0.4rem 1.2rem;
    }
    
    .logo-fallback {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Logo Styling - Ukuran Kecil 2x2 cm */
.logo-container {
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 2cm; /* Tinggi container 2cm */
}

.university-logo {
    height: 2cm; /* Tinggi logo 2cm */
    width: 2cm;  /* Lebar logo 2cm */
    object-fit: contain; /* Pastikan logo tidak terdistorsi */
    object-position: center;
    filter: brightness(0) invert(0); /* Untuk logo hitam */
}

/* Fallback logo */
.logo-fallback {
    width: 2cm;
    height: 2cm;
    background: linear-gradient(135deg, #e74c3c, #c0392b); /* Warna merah khas Usahid */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1cm; /* Ukuran ikon proporsional */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Teks di bawah logo */
.login-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-align: center;
}

.university-badge {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    text-align: center;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-container {
        height: 1.5cm; /* Sedikit lebih kecil di mobile */
        margin-bottom: 0.6rem;
    }
    
    .university-logo {
        height: 1.5cm;
        width: 1.5cm;
    }
    
    .logo-fallback {
        width: 1.5cm;
        height: 1.5cm;
        font-size: 0.8cm;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .university-badge {
        font-size: 0.8rem;
    }
}

/* Untuk layar sangat kecil */
@media (max-width: 480px) {
    .logo-container {
        height: 1.2cm;
        margin-bottom: 0.5rem;
    }
    
    .university-logo {
        height: 1.2cm;
        width: 1.2cm;
    }
    
    .logo-fallback {
        width: 1.2cm;
        height: 1.2cm;
        font-size: 0.6cm;
    }
}

/* Login Header Styling */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Logo Container */
.logo-container {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 2cm; /* Tinggi 2cm */
}

/* Logo Universitas Sahid */
.university-logo {
    width: 2cm;  /* Lebar 2cm */
    height: 2cm; /* Tinggi 2cm */
    object-fit: contain; /* Pastikan gambar tidak terdistorsi */
    object-position: center;
    border-radius: 4px; /* Sedikit rounded corners */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Bayangan halus */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.university-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Fallback logo jika file tidak ditemukan */
.logo-fallback {
    width: 2cm;
    height: 2cm;
    background: linear-gradient(135deg, #e74c3c, #c0392b); /* Warna merah Usahid */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1cm; /* Ukuran ikon proporsional */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Judul Perpustakaan Digital */
.login-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Badge Universitas */
.university-badge {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    text-align: center;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-container {
        height: 1.5cm; /* Sedikit lebih kecil di tablet */
        margin-bottom: 0.8rem;
    }
    
    .university-logo {
        width: 1.5cm;
        height: 1.5cm;
    }
    
    .logo-fallback {
        width: 1.5cm;
        height: 1.5cm;
        font-size: 0.8cm;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .university-badge {
        font-size: 0.8rem;
    }
}

/* Untuk mobile phone */
@media (max-width: 480px) {
    .logo-container {
        height: 1.2cm; /* Lebih kecil di mobile */
        margin-bottom: 0.6rem;
    }
    
    .university-logo {
        width: 1.2cm;
        height: 1.2cm;
    }
    
    .logo-fallback {
        width: 1.2cm;
        height: 1.2cm;
        font-size: 0.6cm;
    }
    
    .login-header h1 {
        font-size: 1.3rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .login-header h1 {
        color: #ecf0f1;
    }
    
    .university-badge {
        color: #bdc3c7;
    }
    
    .university-logo {
        filter: brightness(0.9) contrast(1.1);
    }
}

/* Alternatif dengan pixel (2cm ≈ 76px) */
.logo-container {
    margin-bottom: 1rem;
    height: 76px; /* 2cm dalam pixel */
}

.university-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.logo-fallback {
    width: 76px;
    height: 76px;
    font-size: 38px; /* Setengah dari tinggi */
}

@media (max-width: 768px) {
    .logo-container {
        height: 57px; /* 1.5cm */
    }
    
    .university-logo {
        width: 57px;
        height: 57px;
    }
    
    .logo-fallback {
        width: 57px;
        height: 57px;
        font-size: 28px;
    }
}

#fakultas_display {
    background-color: var(--gray-light);
    border-color: var(--light-color);
    color: var(--gray-dark);
    cursor: not-allowed;
}

/* Layout utama */
.app-layout { display:flex; min-height:100vh; width:100%; }
.sidebar { width:260px; flex:0 0 260px; min-height:100vh; }
.app-main { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; }
.app-content { flex:1 1 auto; padding:16px; }

/* Collapse */
.sidebar.collapsed { width:72px; flex-basis:72px; }
.sidebar.collapsed .menu-text { display:none; }
.sidebar.collapsed .nav-link i { margin-right:0 !important; }

/* Biar link rapi */
/* Sidebar theme mengikuti dashboard */
.sidebar{
    background: var(--primary-color) !important; 
     color: #fff;
     
}

.sidebar .nav-link{
  color: rgba(255,255,255,.88) !important;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 4px 6px;
}

.sidebar .nav-link:hover{
  background: rgba(255,255,255,.10);
  color: #fff !important;
}

.sidebar .nav-link.active{
  background: rgba(255,255,255,.16);
  border-left: 4px solid var(--accent-color);
  padding-left: 10px;
  font-weight: 600;
}

.sidebar .nav-link.text-danger{
  color: #ffb4b4 !important;
}
.sidebar .nav-link.text-danger:hover{
  color: #fff !important;
  background: rgba(255,0,0,.15);
}


/* ===========================
   GLOBAL: Stats layout (3 kolom desktop)
   Pakai class: .stats-row / .stats-grid
   =========================== */

/* Versi flex lama -> kita kunci jadi grid agar tidak turun */
.stats-row{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
}

.stats-grid{
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
}

/* Card statistik umum */
.stats-box,
.stats-card{
  min-width: 0 !important;
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}

/* Responsif */
@media (max-width: 992px){
  .stats-row{ grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .stats-grid{ grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}
@media (max-width: 576px){
  .stats-row{ grid-template-columns: 1fr !important; }
  .stats-grid{ grid-template-columns: 1fr !important; }
}

/* ===========================
   GLOBAL: Action buttons 1 baris
   =========================== */

.action-buttons{
  display: inline-flex !important; /* bukan flex full width */
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap !important;    /* paksa 1 baris */
  white-space: nowrap;
}

/* kecilkan tombol agar tidak makan tempat */
.btn-small{
  padding: 6px 10px !important;
  font-size: .8rem !important;
  line-height: 1 !important;
}

/* rapikan icon */
.btn-small i{
  font-size: .9rem;
}

/* kolom aksi jangan melebar */
table td:last-child,
table th:last-child{
  white-space: nowrap;
  width: 1%;
}

/* ===== Sidebar mobile offcanvas ===== */
@media (max-width: 991.98px){
  .sidebar{
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 1050;
    transform: translateX(-105%);
    transition: transform .25s ease;
    overflow-y: auto;
  }

  body.sidebar-open .sidebar{
    transform: translateX(0);
  }

  /* konten jangan kegeser di mobile */
  .main-content{
    margin-left: 0 !important;
  }

  /* backdrop */
  .sidebar-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  body.sidebar-open .sidebar-backdrop{
    opacity: 1;
    pointer-events: auto;
  }
}
