/* Base Styles */
:root {
  --primary-color: #1e3a8a;
  --primary-light: #2563eb;
  --primary-dark: #172554;
  --secondary-color: #f8fafc;
  --text-color: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --card-bg: #ffffff;
  --gold-color: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f1f5f9;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header Styles */
header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

header p {
  font-size: 1rem;
  opacity: 0.8;
}

/* Navigation Styles */
nav {
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

nav ul {
  display: flex;
  list-style: none;
  overflow-x: auto;
}

nav ul li {
  flex-shrink: 0;
}

nav ul li a {
  display: block;
  padding: 1rem;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

nav ul li a:hover {
  color: var(--primary-light);
}

nav ul li a.active {
  color: var(--primary-light);
  border-bottom: 3px solid var(--primary-light);
}

/* Main Content Styles */
main {
  padding: 2rem 0;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

/* Dashboard Stats */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.stat-change {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Alert Box */
.alert-box {
  background-color: #fff8e6;
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.alert-box h3 {
  color: #92400e;
  margin-bottom: 0.5rem;
}

.alert-box p {
  color: #92400e;
  margin-bottom: 0.5rem;
}

/* Badge Styles */
.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--primary-light);
  color: white;
  min-height: 1.5rem;
  display: inline-flex;
  align-items: center;
}

.badge-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.badge-red {
  background-color: var(--danger-color);
  color: white;
}

.badge-green {
  background-color: var(--success-color);
  color: white;
}

.badge-blue {
  background-color: var(--primary-light);
  color: white;
}

.badge-gray {
  background-color: var(--text-light);
  color: white;
}

.badge-gold {
  background-color: var(--gold-color);
  color: white;
}

.badge-purple {
  background-color: #8b5cf6;
  color: white;
}

/* Button Styles */
.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--primary-light);
  color: white;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.button:hover {
  background-color: var(--primary-dark);
}

.button-secondary {
  background-color: #e2e8f0;
  color: var(--text-color);
}

.button-secondary:hover {
  background-color: #cbd5e1;
}

.button-danger {
  background-color: var(--danger-color);
}

.button-danger:hover {
  background-color: #dc2626;
}

.button-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Icon Button */
.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

/* Quick Actions */
.quick-actions {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Recent Activity */
.recent-activity {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

table th {
  font-weight: 600;
  color: var(--text-light);
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* Form Styles */
.form-container {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Supply Card Styles */
.supply-list,
.customer-list,
.appointment-list,
.service-list {
  display: grid;
  gap: 1.5rem;
}

.supply-card,
.customer-card,
.appointment-card,
.service-card {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.supply-header,
.customer-header,
.appointment-header,
.service-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  min-height: 4rem;
}

.supply-details,
.customer-details,
.appointment-details,
.service-details {
  padding: 1rem;
}

.supply-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat {
  margin-bottom: 0.5rem;
}

.stat label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.stock-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stock-input {
  width: 60px;
}

.alert-message {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: #fee2e2;
  border-radius: 0.25rem;
  color: #b91c1c;
  font-size: 0.875rem;
}

/* Customer Card Styles */
.customer-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.customer-notes,
.appointment-notes {
  padding: 1rem;
  background-color: #f0f9ff;
  border-top: 1px solid #bae6fd;
}

/* Appointment Card Styles */
.appointment-actions {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.appointment-card.completed {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
}

/* Service Card Styles */
.service-description {
  padding: 0 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.service-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.service-stat {
  text-align: center;
}

.price {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--success-color);
}

.rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
}

.star {
  color: #d1d5db;
}

.star.filled {
  color: #fbbf24;
}

.star.half {
  color: #fbbf24;
  opacity: 0.5;
}

.rating-text {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.service-supplies {
  margin-top: 1rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background-color: white;
  border-radius: 0.5rem;
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--primary-color);
  color: white;
  border-radius: 0.5rem 0.5rem 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.modal-form {
  padding: 1.5rem;
}

.modal-form .form-group {
  margin-bottom: 1rem;
}

.modal-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-form .button-group {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Modal Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Success Message Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

.success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #10b981;
  color: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

/* Footer Styles */
footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .stats-container {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .supply-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .customer-details {
    grid-template-columns: 1fr;
  }

  .service-info {
    grid-template-columns: 1fr;
  }

  .appointment-actions {
    flex-direction: column;
  }

  nav ul {
    justify-content: flex-start;
  }

  .modal-content {
    width: 95%;
    margin: 1rem;
  }

  .modal-form .form-row {
    grid-template-columns: 1fr;
  }

  .modal-form .button-group {
    flex-direction: column;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-form {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .supply-stats {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }
}

/* Enhanced button styles for modal */
.modal-form .button {
  min-width: 120px;
  justify-content: center;
}

.modal-form .button-danger {
  background-color: var(--danger-color);
  color: white;
}

.modal-form .button-danger:hover {
  background-color: #dc2626;
}

/* Focus styles for accessibility */
.modal-content:focus {
  outline: none;
}

.modal-close:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Enhanced focus states for better accessibility */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}
