/* === Base Styles === */
body {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding: 2rem;
}

.container {
  background: #1a1a2e;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  width: 600px;
  height: auto;
}

h2,
h4 {
  color: #e0e0ff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

/* === Input Fields === */
input.form-control {
  border-radius: 8px;
  border: none;
  padding: 10px 15px;
  font-size: 1rem;
  background: #2a2a4a;
  color: #eee;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

input.form-control::placeholder {
  color: #aaa;
}

input.form-control:focus {
  outline: none;
  box-shadow: 0 0 10px #667eea;
  background: #3b3b62;
  color: #fff;
}

/* === Buttons === */
.btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: #4e5eff;
  color: #fff;
}

.btn-primary:hover {
  background-color: #5555ff;
}

.btn-success {
  background-color: #28a745;
  color: #fff;
}

.btn-success:hover {
  background-color: #33cc66;
}

.btn-secondary {
  background-color: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #666699;
}

.btn-danger {
  background-color: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c82333;
}

/* Spinner inside button */
.spinner-border-sm {
  vertical-align: middle;
}

/* === Toast Styles === */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1055;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
}

.toast {
  padding: 14px 22px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  opacity: 0.98;
  animation: slideInRight 0.4s ease forwards, fadeOut 0.5s ease forwards 4s;
}

.toast-success {
  background: #28a745;
}

.toast-error {
  background: #dc3545;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 0.98;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

/* === Result Box === */
#result .alert {
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* === Error Text === */
#login-error {
  font-weight: 600;
  color: #ff6666;
  margin-top: 0.5rem;
}

/* === Disabled Button === */
button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === Password Toggle Icon === */
.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: #fff;
}

/* === Form Group with Toggle === */
.password-group {
  position: relative;
}

/* === Responsive Improvements === */
@media (max-width: 576px) {
  .container {
    padding: 1.2rem;
    width: 100%;
  }

  input.form-control {
    font-size: 0.95rem;
    padding: 9px 12px;
  }

  .btn {
    font-size: 0.95rem;
    padding: 10px;
  }

  .toast {
    font-size: 0.85rem;
    padding: 12px 16px;
  }
}

/* Dark mode styles */
body.dark-mode {
  background-color: #1a1d21;
  color: #e9ecef;
}

body.dark-mode .sidebar {
  background: #212529;
  border-right: 1px solid #2c3034;
}

body.dark-mode .card {
  background: #212529;
  border-color: #2c3034;
}

body.dark-mode .nav-link {
  color: #e9ecef;
}

body.dark-mode .nav-link:hover {
  background: #2c3034;
}

body.dark-mode .nav-link.active {
  background: #2c3034;
  color: #0d6efd;
}

body.dark-mode .stats-card {
  background: #212529;
}

body.dark-mode .table {
  color: #e9ecef;
}

body.dark-mode .table-hover tbody tr:hover {
  background-color: #2c3034;
}

body.dark-mode .form-control {
  background-color: #2c3034;
  border-color: #495057;
  color: #e9ecef;
}

body.dark-mode .form-control:focus {
  background-color: #2c3034;
  border-color: #0d6efd;
  color: #e9ecef;
}

body.dark-mode .input-group-text {
  background-color: #2c3034;
  border-color: #495057;
  color: #e9ecef;
}

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

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

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

body.dark-mode ::-webkit-scrollbar-track {
  background: #2c3034;
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: #495057;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #6c757d;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .main-content.sidebar-active {
    margin-left: var(--sidebar-width);
  }
}

/* Card hover effects */
.stats-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Form styling */
.form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Button styling */
.btn {
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Table styling */
.table th {
  font-weight: 600;
  border-bottom-width: 1px;
}

/* Toast styling */
.toast {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Loading spinner */
.spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Badge styling */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
}

/* Input group styling */
.input-group .form-control:focus {
  z-index: 0;
}

.input-group .btn {
  z-index: 0;
}
