/* ========================================
   PVTM Document Management System - Site CSS
   ======================================== */

/* Base Styles */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  margin-bottom: 0;
}

/* Sidebar Navigation */
#sidebar-wrapper {
  transition: margin-left 0.25s ease-out;
}

#sidebar-wrapper .nav-link {
  transition: all 0.2s ease;
  border-radius: 0;
}

#sidebar-wrapper .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#sidebar-wrapper .nav-link.active {
  background-color: #0d6efd !important;
  font-weight: 500;
}

/* Page Content */
#page-content-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#page-content-wrapper .container-fluid.p-4 {
  flex: 1;
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
}

/* Status Badges */
.badge.bg-success {
  background-color: #198754 !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
}

.badge.bg-secondary {
  background-color: #6c757d !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
}

/* Form Styles */
.form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.25rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Button Styles */
.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
}

.btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

/* DevExtreme Overrides */
.dx-datagrid {
  border-radius: 0.5rem;
  overflow: hidden;
}

.dx-datagrid .dx-header-row {
  background-color: #f8f9fa;
  font-weight: 600;
}

.dx-datagrid .dx-row-alt > td {
  background-color: #f8f9fa;
}

.dx-toolbar {
  padding: 0.5rem 0;
}

/* Page Header */
.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.page-header h2 {
  margin-bottom: 0.25rem;
  color: #212529;
  font-weight: 600;
}

.page-header p {
  color: #6c757d;
  margin-bottom: 0;
}

/* Stat Cards */
.stat-card {
  padding: 1.25rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stat-card.blue {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
}

.stat-card.green {
  background: linear-gradient(135deg, #198754 0%, #157347 100%);
}

.stat-card.orange {
  background: linear-gradient(135deg, #fd7e14 0%, #e66a0b 100%);
}

.stat-card.purple {
  background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1050;
}

/* Filter Panel */
.filter-panel {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar-wrapper {
    margin-left: -250px;
  }

  #wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
  }
}

/* Focus States */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow:
    0 0 0 0.1rem white,
    0 0 0 0.25rem #258cfb;
}

/* Table Styles */
.table th {
  font-weight: 600;
  background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Action Buttons Group */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Sidebar improvements */
#sidebar-wrapper {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

#sidebar-wrapper .sidebar-heading {
  background: rgba(0, 0, 0, 0.2);
}

#sidebar-wrapper .nav-link {
  padding: 0.75rem 1rem;
  margin: 0.25rem 0.5rem;
  border-radius: 0.5rem;
}

#sidebar-wrapper .nav-link i {
  width: 20px;
  text-align: center;
}

/* Card hover effect */
.card {
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Stat card hover */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Button improvements */
.btn {
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.3);
}

/* Table row click effect */
.table-hover tbody tr {
  transition: background-color 0.15s ease;
  cursor: pointer;
}

/* DataGrid row hover */
.dx-datagrid-content .dx-row:hover td {
  background-color: rgba(13, 110, 253, 0.05) !important;
}

/* Modal improvements */
.modal-content {
  border: none;
  border-radius: 0.75rem;
}

.modal-header {
  background-color: #f8f9fa;
  border-radius: 0.75rem 0.75rem 0 0;
}

/* Dropdown shadows */
.dropdown-menu {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border: none;
}

/* Navbar user dropdown */
#userDropdown:focus {
  box-shadow: none;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Print styles */
@media print {
  #sidebar-wrapper,
  .navbar,
  footer,
  .action-buttons {
    display: none !important;
  }
  
  #page-content-wrapper {
    margin-left: 0 !important;
  }
}

