/* ZKTeco Attendance System - Custom Styles */

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  --gradient-danger: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
  --gradient-info: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
  --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-medium: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-heavy: 0 8px 32px rgba(0,0,0,0.2);
  --border-radius: 10px;
  --transition: all 0.3s ease;
}

/* Global Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: var(--dark-color);
}

/* Sidebar Styles */
.sidebar {
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
  min-height: 100vh;
  box-shadow: var(--shadow-medium);
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  z-index: 1000;
  transition: var(--transition);
}

.sidebar .logo {
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
}

.sidebar .logo h4 {
  color: white;
  margin: 0;
  font-weight: 600;
  font-size: 1.2rem;
}

.sidebar .logo i {
  font-size: 2rem;
  color: var(--primary-color);
  display: block;
  margin-bottom: 0.5rem;
}

.sidebar .nav-link {
  color: rgba(255,255,255,0.8);
  padding: 1rem 1.5rem;
  border-radius: 0;
  transition: var(--transition);
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left-color: var(--primary-color);
  transform: translateX(5px);
}

.sidebar .nav-link.active {
  background: var(--gradient-primary);
  color: white;
  border-left-color: white;
}

.sidebar .nav-link i {
  width: 20px;
  margin-right: 10px;
}

/* Main Content */
.main-content {
  margin-left: 250px;
  padding: 2rem;
  min-height: 100vh;
  transition: var(--transition);
}

/* Card Styles */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.card-header {
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  padding: 1.25rem;
}

.card-header h5 {
  margin: 0;
  color: var(--dark-color);
  font-weight: 600;
  display: flex;
  align-items: center;
}

.card-header h5 i {
  margin-right: 10px;
  color: var(--primary-color);
}

.card-body {
  padding: 1.5rem;
}

/* Statistics Cards */
.card-stats {
  background: var(--gradient-primary);
  color: white;
  border: none;
  overflow: hidden;
  position: relative;
}

.card-stats::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transition: var(--transition);
  transform: scale(0);
}

.card-stats:hover::before {
  transform: scale(1);
}

.card-stats.success {
  background: var(--gradient-success);
}

.card-stats.danger {
  background: var(--gradient-danger);
}

.card-stats.info {
  background: var(--gradient-info);
}

.card-stats .card-body {
  position: relative;
  z-index: 2;
}

.card-stats .numbers {
  position: relative;
  z-index: 2;
}

.card-stats .card-category {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.card-stats .card-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}

.card-stats .icon-big {
  font-size: 3rem;
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Tables */
.table-responsive {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.table {
  margin: 0;
}

.table thead th {
  background: var(--gradient-primary);
  color: white;
  border: none;
  font-weight: 600;
  padding: 1rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 50px;
  font-weight: 500;
}

.status-online {
  color: var(--success-color);
  background: rgba(40, 167, 69, 0.1);
}

.status-offline {
  color: var(--danger-color);
  background: rgba(220, 53, 69, 0.1);
}

/* Buttons */
.btn {
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-light);
}

.btn-primary:hover {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.btn-success {
  background: var(--gradient-success);
}

.btn-danger {
  background: var(--gradient-danger);
}

.btn-info {
  background: var(--gradient-info);
}

.btn-sm {
  padding: 0.25rem 1rem;
  font-size: 0.875rem;
}

/* Forms */
.form-control {
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

/* Page Header */
.page-header {
  background: white;
  padding: 2rem;
  margin: -2rem -2rem 2rem -2rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  box-shadow: var(--shadow-light);
}

.page-header h1 {
  margin: 0;
  color: var(--dark-color);
  font-weight: 700;
  display: flex;
  align-items: center;
}

.page-header h1 i {
  margin-right: 15px;
  color: var(--primary-color);
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 400px;
  padding: 1rem;
}

/* Device Status */
.device-status-item {
  padding: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: var(--transition);
}

.device-status-item:hover {
  background: rgba(102, 126, 234, 0.05);
}

.device-status-item:last-child {
  border-bottom: none;
}

.device-info {
  flex: 1;
}

.device-name {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0.25rem;
}

.device-ip {
  font-size: 0.875rem;
  color: #6c757d;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 250px;
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  
  .card-stats .card-title {
    font-size: 2rem;
  }
  
  .card-stats .icon-big {
    font-size: 2rem;
  }
  
  .page-header {
    margin: -1rem -1rem 1rem -1rem;
    padding: 1.5rem 1rem;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  box-shadow: var(--shadow-medium);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-heavy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition);
  z-index: 1000;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 40px rgba(102, 126, 234, 0.4);
}

/* Progress Bars */
.progress {
  height: 8px;
  border-radius: 50px;
  background: rgba(0,0,0,0.1);
}

.progress-bar {
  border-radius: 50px;
  background: var(--gradient-primary);
}

/* Tooltips */
.tooltip-inner {
  background: var(--dark-color);
  border-radius: var(--border-radius);
}

/* Modal Enhancements */
.modal-content {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-heavy);
}

.modal-header {
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .btn-close {
  filter: invert(1);
}

/* Data Tables Enhancement */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: var(--border-radius);
  padding: 0.5rem;
}

/* Print Styles */
@media print {
  .sidebar,
  .mobile-menu-btn,
  .fab,
  .btn {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}