/* Base Styles & Variables
 * :root {
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1f2b4d;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --border-color: #2d3748;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s ease;
}
 */

 /* Light Theme – Human / Professional */

:root {
  --bg-primary: #f6f7fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f8;

  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  --accent-primary: #2563eb;
  --accent-secondary: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);

  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;

  --border-color: #e5e7eb;

  --border-radius: 12px;
  --border-radius-sm: 8px;

  --shadow-sm: 0 2px 4px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);

  --transition: all .25s ease;
}


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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    var(--bg-primary);
}

.login-container {
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: fadeIn 0.5s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

/* Error Message */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* Login Footer */
.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.login-footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--text-primary);
}

/* Dashboard */
.dashboard-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    var(--bg-primary);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-user span {
  color: var(--text-secondary);
}

/* Dashboard Container */
.dashboard-container {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  animation: fadeIn 0.5s ease;
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.card-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Prescription Form */
.prescription-form-card form {
  padding: 24px;
}

.form-section {
  margin-bottom: 28px;
}

.form-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.section-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* Search Container */
.search-container {
  position: relative;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.dropdown-item:hover {
  background: var(--bg-card-hover);
}

.dropdown-item .medicine-name {
  font-weight: 500;
  display: block;
}

.dropdown-item .medicine-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Selected Medicine */
.selected-medicine {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--accent-primary);
  border-radius: var(--border-radius-sm);
  margin-top: 12px;
}

.selected-medicine .medicine-name {
  font-weight: 500;
}

.selected-medicine .medicine-dosage {
  color: var(--accent-primary);
  font-size: 0.9rem;
}

.remove-medicine {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.remove-medicine:hover {
  color: var(--error);
}

/* Timing Options */
.timing-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .timing-options {
    grid-template-columns: 1fr;
  }
}

.timing-checkbox {
  cursor: pointer;
}

.timing-checkbox input {
  display: none;
}

.timing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  text-align: center;
}

.timing-card svg {
  color: var(--text-muted);
  transition: var(--transition);
}

.timing-card span {
  font-weight: 500;
}

.timing-card small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timing-checkbox input:checked+.timing-card {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.timing-checkbox input:checked+.timing-card svg {
  color: var(--accent-primary);
}

.timing-checkbox:hover .timing-card {
  border-color: var(--accent-primary);
}

/* Custom Times */
.custom-times-section {
  margin-top: 16px;
}

.custom-times-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.custom-times-header h4 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.custom-times-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.custom-time-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  animation: fadeIn 0.3s ease;
}

.custom-time-item input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 80px;
  cursor: pointer;
}

.custom-time-item input:focus {
  outline: none;
}

.custom-time-item button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.custom-time-item button:hover {
  color: var(--error);
}

/* Prescriptions List */
.prescriptions-list-card {
  display: flex;
  flex-direction: column;
}

.prescriptions-list {
  flex: 1;
  padding: 16px;
  max-height: 600px;
  overflow-y: auto;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-state span {
  font-size: 0.9rem;
}

/* Prescription Item */
.prescription-item {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  animation: slideUp 0.3s ease;
}

.prescription-item:hover {
  border-color: var(--accent-primary);
}

.prescription-item:last-child {
  margin-bottom: 0;
}

.prescription-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.prescription-patient {
  font-weight: 600;
  font-size: 1rem;
}

.prescription-patient-id {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.prescription-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.prescription-medicine {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.prescription-medicine-name {
  font-weight: 500;
  color: var(--accent-primary);
}

.prescription-medicine-dosage {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.prescription-timings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timing-tag {
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-primary);
  text-transform: capitalize;
}

.timing-tag.custom {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  z-index: 1000;
}

.toast svg {
  color: var(--success);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
