/* Global Styles */
body {
  font-family: 'Inter', sans-serif;
  background-color: #f8f9fa;
}

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  width: 250px;
  background: #212529;
  color: white;
  transition: all 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: nowrap;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 70px;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-text,
.sidebar.collapsed hr {
  display: none;
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .nav-link,
.sidebar.collapsed .dropdown-toggle {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar.collapsed .nav-link i,
.sidebar.collapsed .sidebar-header i,
.sidebar.collapsed .dropdown-toggle i {
  margin-right: 0 !important;
  font-size: 1.25rem;
}

.sidebar a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.2s;
}

.sidebar .nav-link:hover {
  color: white !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.sidebar .nav-link.active,
.sidebar .nav-link.active i {
  color: #0d6efd !important;
  background: transparent !important;
  font-weight: 600;
}

.navbar {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
}

.btn-primary {
  background-color: #0d6efd;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
}

.btn-primary:hover {
  background-color: #0b5ed7;
}

/* Login Page Styles */
.login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 450px;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  background: white;
  animation: slideUp 0.5s ease-out;
}

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

.login-card .form-control {
  border-radius: 0.5rem;
  border: 1px solid #e0e0e0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.login-card .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.login-card .form-label {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.login-card .btn-primary {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  transition: all 0.3s ease;
}

.login-card .btn-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3e8f 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.login-card .text-muted {
  font-size: 0.85rem;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
  .login-page {
    padding: 15px;
  }

  .login-card {
    padding: 1.5rem 1rem;
  }

  .login-card h1 {
    font-size: 1.5rem;
  }

  .login-card h3 {
    font-size: 1.25rem;
  }

  .login-card .form-control {
    font-size: 16px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .login-card {
    padding: 2.5rem 2rem;
  }
}

@media (min-width: 1200px) {
  .login-card {
    padding: 3rem 2.5rem;
  }
}

.login-card .btn-primary {
  padding: 0.75rem;
  font-weight: 600;
}

/* Student ID Card Styles */
.id-card-view {
  background: #f8f9fa;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

.id-card {
  width: 85.6mm;
  height: 54mm;
  background: white;
  border: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  padding: 3mm;
  box-sizing: border-box;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  border-radius: 6px;
  page-break-inside: avoid;
  margin-bottom: 0;
}

.id-card .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1mm;
  border-bottom: 2px solid #0d6efd;
  padding-bottom: 2mm;
  margin-bottom: 2mm;
}

.id-card .logo {
  width: 10mm;
  height: 10mm;
  object-fit: contain;
}

.id-card .header {
  font-size: 11px;
  font-weight: 800;
  color: #0d6efd;
  /* text-transform: uppercase; */
  letter-spacing: 0.3px;
  margin: 0;
  text-align: center;
  align-self: center;
  line-height: 1.2;
}

.id-card .card-body {
  display: flex;
  align-items: center;
  gap: 5mm;
  flex: 1;
  padding-top: 1mm;
  justify-content: flex-start;
}

.id-card .card-body.back-side {
  flex-direction: column;
  justify-content: flex-start;
  /* padding: 2mm 3mm; */
  gap: 2mm;
}

.id-card .card-body.back-side .details-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  /* gap: 1mm; */
}

.id-card .detail-row {
  display: flex;
  align-items: baseline;
  /* gap: 1mm; */
}

.id-card .detail-row .label {
  flex: 0 0 35mm;
  font-size: 6pt;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.5mm;
}

.id-card .detail-row .name {
  flex: 1;
  font-size: 10px;
  font-weight: bold;
  color: #212529;
  margin-bottom: 2mm;
  line-height: 1.1;
  word-break: break-word;
}

.id-card .card-body.back-side .footer-section {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  margin-top: 10px;
}

.id-card .card-body.back-side .qr-container {
  display: flex;
  justify-content: space-around;
  margin-top: 0;
}

.id-card .card-body.back-side .bottom-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-items: center;
  margin-top: 0;
}

.id-card .card-body.back-side .bottom-section img {
  height: 8mm;
  width: auto;
  margin-bottom: 0mm;
}

.id-card .photo img {
  width: 20mm;
  height: 25mm;
  object-fit: cover;
  border: 1px solid #000;
}

.id-card .qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.id-card .qr-code {
  flex: 0 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.id-card .qr-code canvas,
.id-card .qr-code img {
  width: 22mm !important;
  height: 22mm !important;
}

.id-card .details {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.id-card .label {
  font-size: 6pt;
  color: #6c757d;
  text-transform: uppercase;
  margin-bottom: 0.5mm;
  font-weight: 600;
}

.id-card .name {
  font-size: 10px;
  font-weight: bold;
  color: #212529;
  margin-bottom: 2mm;
  line-height: 1.1;
  word-break: break-word;
}

.id-card .nic {
  font-size: 10px;
  font-weight: bold;
  color: #212529;
  margin-bottom: 2mm;
  line-height: 1.1;
  word-break: break-word;
}

.id-card .year-batch {
  position: absolute;
  bottom: 4mm;
  right: 4mm;
  font-size: 6pt;
  color: #adb5bd;
  font-weight: 600;
}

table thead tr th {
  text-align: center;
  vertical-align: middle;
}

table tbody tr td {
  vertical-align: middle !important;
}

/* Bulk Print Container */
.print-container {
  display: grid;
  grid-template-columns: repeat(2, 85.6mm);
  gap: 5mm 10mm;
  justify-content: center;
  padding: 10mm;
}

@media print {
  body.id-card-view {
    background: none;
  }

  body.bulk-print {
    background: white;
    padding: 0;
  }

  .print-container {
    padding: 0;
    gap: 5mm;
  }

  .id-card {
    box-shadow: none;
    border: 1px solid #000;
  }

  .no-print {
    display: none;
  }

  @page {
    size: A4;
    margin: 10mm;
  }
}

/* Mobile Responsive Sidebar */
@media (max-width: 767.98px) {
  .sidebar {
    position: fixed;
    left: -250px;
    z-index: 1050;
    height: 100%;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar.collapsed {
    width: 250px; /* Disable collapse on mobile, just hide/show */
    left: -250px;
  }

  .sidebar.collapsed.show {
    left: 0;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sidebar-backdrop.show {
    display: block;
    opacity: 1;
  }
}

/* Site Footer */
.site-footer {
  background: #fff;
  border-top: 1px solid #edf2f9;
  color: #6c757d;
  transition: all 0.3s ease;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
