:root {
    --sidebar-width: 250px;
    --primary-color: #48CAE4; /* Biru langit */
    --secondary-color: #90E0EF; /* Biru langit muda */
    --hover-color: #00B4D8; /* Biru langit tua */
    --text-color: #03045E; /* Biru gelap */
}

body {
    background-image: url('../img/background.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    min-height: 100vh;
}

.wrapper {
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 3px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.sidebar .logo-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 8px;
}

.sidebar .logo-container img {
    width: 80px;
    height: auto;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.sidebar h3 {
    color: var(--text-color);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
    font-weight: 600;
    text-align: center;
    padding: 10px 0;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    font-size: 1.5rem;
}

.sidebar .nav-link {
    color: var(--text-color);
    padding: 12px 20px;
    margin-bottom: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.3);
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 10px;
    min-height: 100vh;
    padding-bottom: 60px;
}

.content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    padding-bottom: 60px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.btn {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
    color: white;
}

.alert {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
}

.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.table thead {
    background-color: var(--primary-color);
    color: var(--text-color);
}

/* Login page specific styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: rgba(63, 225, 247, 0.5);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(245, 237, 4, 0.4);
}

.form-control {
    border-radius: 8px;
    border-color: var(--primary-color);
}

.form-control:focus {
    border-color: var(--hover-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 180, 216, 0.25);
}

/* Update style untuk user info */
.sidebar .user-info {
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    margin: 0 -5px 15px -5px;
}

.sidebar .user-info h6 {
    color: var(--text-color);
    font-weight: 600;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.sidebar .user-info i {
    color: var(--text-color);
    opacity: 0.9;
    font-size: 2.5em;
    margin-bottom: 5px !important;
}

.sidebar .user-info small {
    font-size: 0.75em;
    opacity: 0.8;
    color: var(--text-color);
}

/* Style untuk footer */
.footer {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 0;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    margin: 0 20px 10px 20px;
    border-radius: 6px;
    box-shadow: 0 -1px 5px rgba(0,0,0,0.05);
    z-index: 1000;
}

.footer p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.8rem;
}

.footer .copyright {
    font-weight: 400;
}

.qr-code-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-block;
    margin: 1rem auto;
}

.qr-wrapper {
    background: white;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-block;
}

.qr-wrapper svg {
    width: 200px;
    height: 200px;
    display: block;
}

.user-select-all {
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 220px;
  }
  
  .content-wrapper {
    padding: 15px;
  }
}

@media (max-width: 992px) {
  :root {
    --sidebar-width: 200px;
  }

  .sidebar h3 {
    font-size: 1.2rem;
  }
  
  .sidebar .nav-link {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }
  
  .wrapper {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    min-height: auto;
    position: fixed;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    z-index: 1050;
    top: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar .logo-container {
    display: flex;
    align-items: center;
  }

  .sidebar .logo-container img {
    height: 40px;
    margin-right: 10px;
  }

  .sidebar .logo-container h3 {
    color: white;
    margin: 0;
    font-size: 1.2em;
  }

  .sidebar .user-info {
    display: none;
  }

  .sidebar .nav.flex-column {
    display: none;
  }

  /* Base style untuk mobile navbar */
  .mobile-navbar {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgb(125, 241, 248);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1040;
    padding: 10px 0;
  }

  /* Media query untuk mobile */
  @media (max-width: 768px) {
    /* ... kode media query lainnya ... */

    /* Explicitly show mobile navbar */
    .mobile-navbar {
        display: flex !important; /* Gunakan !important untuk memastikan override */
        justify-content: space-around;
        align-items: center;
    }

    /* Style untuk link dalam mobile navbar */
    .mobile-navbar .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: var(--text-color);
        padding: 8px 12px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .mobile-navbar .nav-link i {
        font-size: 1.2em;
        margin-bottom: 4px;
    }

    .mobile-navbar .nav-link span {
        font-size: 0.75em;
    }

    .mobile-navbar .nav-link.active {
        background-color: var(--primary-color);
        color: white;
    }
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 10px;
    padding-bottom: 70px;
    padding-top: 10px;
  }

  .content-wrapper {
    padding: 15px;
  }

  .footer {
    bottom: 60px;
  }
}

@media (max-width: 576px) {
  .content-wrapper {
    padding: 10px;
  }
  
  .card-body {
    padding: 15px;
  }
  
  /* Adjust search form */
  .search-form .col-md-5,
  .search-form .col-md-3,
  .search-form .col-md-1 {
    margin-bottom: 10px;
  }
  
  /* Adjust document list */
  .document-icon {
    width: 35px;
    height: 35px;
  }
  
  .document-info {
    max-width: 150px;
  }
  
  .document-name {
    font-size: 0.8rem;
  }
  
  /* Ganti dengan aturan yang membuat tabel bisa di-scroll horizontal */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Pastikan semua kolom memiliki lebar minimum */
  .table th,
  .table td {
    white-space: nowrap;
    min-width: 100px;
  }

  /* Kolom aksi bisa lebih kecil */
  .table th:last-child,
  .table td:last-child {
    min-width: 80px;
  }
}

/* Toggle Sidebar Button */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1050;
  background: var(--primary-color);
  border: none;
  padding: 8px;
  border-radius: 5px;
  color: white;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed;
    z-index: 1040;
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
}

/* Pastikan mobile navbar tersembunyi secara default untuk desktop */
.mobile-navbar {
    display: none;
}

/* View Document Page Styles */
.view-document {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.view-document .document-header {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.view-document .document-header h4 {
    margin: 10px 0;
    font-size: 1.2rem;
    word-break: break-word;
}

.view-document .document-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.view-document .back-button {
    margin-bottom: 10px;
}

.view-document .pdf-container {
    flex: 1;
    position: relative;
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 400px;
}

.view-document .pdf-viewer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive styles for view document */
@media (max-width: 768px) {
    .view-document {
        height: calc(100vh - 56px);
    }

    .view-document .document-header {
        padding: 10px;
        margin-bottom: 10px;
    }

    .view-document .document-header h4 {
        font-size: 1rem;
    }

    .view-document .back-button .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .view-document .pdf-container {
        min-height: 300px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .view-document {
        height: auto;
        min-height: 100vh;
    }

    .view-document .pdf-container {
        height: 70vh;
    }
}

@media (max-width: 576px) {
    .view-document .document-header {
        padding: 8px;
    }

    .view-document .document-info .badge {
        font-size: 0.75rem;
    }

    .view-document .pdf-container {
        min-height: 250px;
    }
}

/* Mobile User Info Styles */
.mobile-user-info {
    display: none;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Adjust main content padding for mobile */
@media (max-width: 768px) {
    .container-fluid {
        padding-bottom: 65px; /* Sesuaikan dengan tinggi mobile-user-info */
    }

    .mobile-user-info {
        display: block;
    }

    /* Style untuk user avatar di mobile */
    .user-avatar {
        font-size: 16px;
        background: linear-gradient(45deg, #007bff, #0056b3);
    }

    /* Style untuk username dan role */
    .mobile-user-info .fw-bold {
        font-size: 14px;
        margin-bottom: -3px;
    }

    .mobile-user-info .text-muted {
        font-size: 12px;
    }

    /* Style untuk tombol logout */
    .mobile-user-info .btn-outline-danger {
        padding: 4px 8px;
        font-size: 14px;
    }

    /* Animasi hover untuk tombol logout */
    .mobile-user-info .btn-outline-danger:hover {
        background-color: #dc3545;
        color: white;
        transition: all 0.3s ease;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mobile-user-info {
        background-color: #343a40 !important;
        border-top-color: #454d55 !important;
    }

    .mobile-user-info .fw-bold {
        color: #fff;
    }

    .mobile-user-info .text-muted {
        color: #adb5bd !important;
    }
}

/* Mobile Navbar Styles */
.mobile-navbar {
    display: none;
    z-index: 1000;
    background-color: var(--bs-white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-navbar .nav-link {
    color: var(--bs-gray-600);
    text-decoration: none;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.mobile-navbar .nav-link i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.mobile-navbar .nav-link.active {
    color: var(--bs-primary);
}

/* Hover effect */
.mobile-navbar .nav-link:hover {
    color: var(--bs-primary);
}

/* Dark Mode Styles */
[data-theme="dark"] .mobile-navbar {
    background-color: #343a40;
    border-top-color: #454d55;
}

[data-theme="dark"] .mobile-navbar .nav-link {
    color: #adb5bd;
}

[data-theme="dark"] .mobile-navbar .nav-link:hover,
[data-theme="dark"] .mobile-navbar .nav-link.active {
    color: #fff;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .mobile-navbar {
        display: block;
    }

    .container-fluid {
        padding-bottom: 70px;
    }
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.user-details .username {
    font-weight: bold;
    font-size: 14px;
    color: var(--bs-dark);
    margin-bottom: -3px;
}

.user-details .role {
    font-size: 12px;
    color: var(--bs-gray-600);
}

.dark-mode-toggle {
    color: var(--bs-gray-600);
    padding: 4px 8px;
}

/* Dark Mode Styles */
[data-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #f8f9fa;
}

[data-theme="dark"] .mobile-navbar {
    background-color: #343a40;
    border-top-color: #454d55;
}

[data-theme="dark"] .user-details .username {
    color: #fff;
}

[data-theme="dark"] .user-details .role {
    color: #adb5bd;
}

[data-theme="dark"] .dark-mode-toggle {
    color: #fff;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .mobile-navbar {
        display: block;
    }

    .container-fluid {
        padding-bottom: 70px;
    }

    .dark-mode-toggle:hover {
        color: #ffc107;
    }

    .btn-outline-danger {
        border-color: #dc3545;
        color: #dc3545;
    }

    .btn-outline-danger:hover {
        background-color: #dc3545;
        color: white;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Dark mode support for loading */
[data-theme="dark"] .loading-overlay {
    background: rgba(0,0,0,0.8);
}
