/* Common Styles for Admin Pages */

/* Base Layout */
body {
  font-family: 'Poppins', sans-serif;
  background: #f7f9fc;
  padding-top: 80px;
  margin: 0;
  color: #333;
}

.container {
  max-width: 95%;
  margin: 20px auto;
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
  padding: 15px 12px;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
}

th {
  background: #007bff;
  color: white;
  font-weight: 600;
}

tr:nth-child(even) {
  background: #f8f9fa;
}

tr:hover {
  background: #e3f2fd;
  transition: background 0.2s ease;
}

/* Button Styles */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.btn-add {
  background: linear-gradient(45deg, #28a745, #20c997);
  margin-bottom: 15px;
}

.btn-edit {
  background: #007bff;
}

.btn-delete {
  background: #dc3545;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  opacity: 0.95;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal.modal-active {
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  width: 500px;
  max-width: 90vw;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.close-btn:hover {
  color: #333;
}

.modal-content h2 {
  margin-top: 0;
  color: #333;
  font-size: 24px;
  text-align: center;
  margin-bottom: 20px;
}

/* Form Styles */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-group.half {
  flex: 1;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
  padding: 20px 30px 25px;
  border-top: 1px solid #e9ecef;
  background: rgba(248,249,250,0.3);
}

.modal-actions button {
  min-width: 100px;
  font-size: 14px;
  font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Logout Modal Specific Styles */
.logout-modal-overlay {
  display: none;
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.logout-modal-overlay.logout-modal-active {
  animation: fadeIn 0.3s ease-out;
}

.logout-modal-content {
  max-width: 400px;
  text-align: center;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.1);
  border: 1px solid rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.logout-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
  padding: 20px 30px 15px;
  margin-bottom: 20px;
  background: rgba(248,249,250,0.5);
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  color: #333;
  font-weight: 600;
}

.modal-body {
  margin-bottom: 25px;
  padding: 0 30px;
}

.logout-icon {
  font-size: 56px;
  color: #dc3545;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(220,53,69,0.3);
  animation: pulse 2s infinite;
}

.logout-icon i {
  display: block;
}

.modal-body p {
  color: #666;
  font-size: 16px;
  margin: 0;
  line-height: 1.6;
  font-weight: 400;
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none;
  color: white !important;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(40,167,69,0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #20c997, #17a2b8);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40,167,69,0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  border: none;
  color: white !important;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(220,53,69,0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220,53,69,0.4);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    margin: 10px 5px;
    padding: 10px;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 8px 6px;
  }

  .btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .modal-content {
    width: 95%;
    padding: 15px;
  }

  .form-row {
    flex-direction: column;
  }

  .form-group.half {
    flex: none;
  }

  .logout-modal-content {
    max-width: 90%;
    padding: 20px;
  }

  .logout-modal-overlay {
    padding: 20px;
  }

  .modal-header {
    padding: 15px 20px 10px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal-body {
    padding: 0 20px;
  }

  .logout-icon {
    font-size: 40px;
    margin-bottom: 15px;
  }

  .modal-body p {
    font-size: 14px;
  }

  .modal-actions {
    padding: 15px 20px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .modal-actions button {
    width: 100%;
    min-width: unset;
  }
}