/* START OF FILE styles.css */

/* Global Resets & Variables */
:root {
  --primary-color: #4a90e2; /* Blue */
  --secondary-color: #50e3c2; /* Green-ish */
  --accent-color: #ff7d7d; /* Red for errors/alerts */
  --background-light: #e6efff;
  --background-dark: #f0f4f8;
  --text-dark: #2c3e50;
  --text-light: #ecf0f1;
  --card-background: rgba(255, 255, 255, 0.7);
  --card-border: rgba(255, 255, 255, 0.3);
  --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
  --shadow-deep: 0 10px 30px rgba(0, 0, 0, 0.15);
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
}

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

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    var(--background-light) 0%,
    var(--background-dark) 100%
  );
  overflow-x: hidden;
}

/* Apply centering flexbox only to specific page bodies */
.landing-page,
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Poppins", sans-serif;
  color: var(--text-dark);
  margin-bottom: 0.8em;
}

p {
  font-family: "Roboto", sans-serif;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #3a7bd5; /* A slightly darker primary */
}

/* Forms & Inputs */
input,
select,
button,
textarea {
  font-family: "Roboto", sans-serif;
  font-size: 1rem;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  margin: 0; /* Remove default margin */
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

input[type="file"] {
  padding: 8px 10px; /* Adjust padding for file input */
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Buttons */
.btn {
  padding: 12px 25px;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
  background: #3a7bd5;
  box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--text-dark);
  box-shadow: 0 5px 15px rgba(80, 227, 194, 0.3);
}

.btn-secondary:hover {
  background: #40c7ac;
  box-shadow: 0 8px 20px rgba(80, 227, 194, 0.4);
}

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

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.btn-submit {
  width: 100%;
  margin-top: 20px;
}

.btn .spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  position: absolute; /* Position spinner over text */
}

.btn .spinner.hidden {
  display: none;
}

.btn span {
  transition: visibility 0.3s;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Glass Card styles (used across pages) */
.glass-card {
  background: var(--card-background);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-deep);
  padding: 30px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.card-title {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 25px;
  text-align: center;
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification {
  background-color: #fff;
  padding: 15px 20px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-light);
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  min-width: 250px;
  opacity: 1;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  transform: translateX(0);
}

.notification.success {
  border-left: 5px solid var(--secondary-color);
  color: #317f69;
}

.notification.error {
  border-left: 5px solid var(--accent-color);
  color: #923030;
}

.notification.warning {
  border-left: 5px solid #ffc107;
  color: #8a6d03;
}

.notification.fade-out {
  opacity: 0;
  transform: translateX(100%);
}

/* Landing Page */
.landing-page {
  background: linear-gradient(
    135deg,
    #a7bfe8 0%,
    #6190e8 100%
  ); /* More vibrant blue gradient */
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.landing-page .glass-container {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  padding: 60px 40px;
  max-width: 600px;
  text-align: center;
  /* color: var(--text-light); -- Removed global text-light for more specific control */
  animation: fadeIn 1s ease-out;
}

.landing-page .logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.landing-page .logo .icon {
  font-size: 3.5rem;
  margin-right: 15px;
  animation: pulse 2s infinite alternate;
  color: #fff; /* Ensure icon is white */
}

.landing-page .app-title {
  font-size: 3rem;
  font-weight: 700;
  color: #fff; /* Pure white for title */
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4); /* Stronger shadow */
  margin-bottom: 0;
}

.landing-page .tagline {
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 10px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.95); /* Increased opacity */
}

.landing-page .description {
  font-size: 1.1rem;
  margin-bottom: 40px;
  color: rgba(255, 255, 255, 0.9); /* Increased opacity */
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.landing-page .btn-group {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.landing-page .btn {
  padding: 15px 30px;
  font-size: 1.1rem;
  border-radius: var(--border-radius-lg);
  text-transform: uppercase;
}

.landing-page .btn-primary {
  background: #fff;
  color: var(--primary-color);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.landing-page .btn-primary:hover {
  background: #f0f0f0;
  color: #3a7bd5;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.landing-page .btn-secondary {
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: #fff;
}

.landing-page .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

/* Auth Pages (Login/Register) */
.auth-page {
  background: linear-gradient(to top right, #e0f7ff, #f9fcff);
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #ffffffee;
  padding: 40px;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: slideIn 0.8s ease-out;
}

.auth-header {
  margin-bottom: 30px;
}

.auth-header .icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}

.auth-card h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.auth-card p {
  color: #777;
  font-size: 0.95rem;
}

.auth-footer {
  margin-top: 25px;
  font-size: 0.9em;
  color: #666;
}

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

/* Dashboard Page */
.dashboard-page {
  background: linear-gradient(
    135deg,
    #f5f7fa 0%,
    #c3cfe2 100%
  ); /* Softer, professional gradient */
  display: block; /* Ensures normal block flow for header and main */
  padding: 0; /* Remove padding from body as header/main will manage it */
}

.dashboard-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  padding: 15px 40px;
  position: sticky;
  top: 0;
  z-index: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dashboard-header .header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-header .logo {
  display: flex;
  align-items: center;
}

.dashboard-header .logo .icon {
  font-size: 2rem;
  margin-right: 10px;
}

.dashboard-header .app-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0;
}

.dashboard-header .user-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dashboard-header #userGreeting {
  font-weight: 500;
  color: #555;
  font-size: 1rem;
}

/* 🚀 NEW LAYOUT FOR DOCTOR DASHBOARD */
.dashboard-main {
  display: grid; /* Use grid for main layout */
  grid-template-columns: 1fr; /* Default to single column for small screens */
  gap: 30px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  align-items: start; /* Align grid items to the start of their area */
}

@media (min-width: 992px) {
  .dashboard-main.doctor-layout { /* Apply this class to dashboard-main when doctor is logged in */
    grid-template-columns: 1.2fr 2.8fr; /* More defined columns for doctor's two main sections */
    gap: 30px; /* Keep gap consistent */
  }
  .dashboard-main.patient-layout { /* Keep previous patient layout if desired */
      grid-template-columns: 1fr 2fr;
  }
}

.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 30px;
  /* Removed flex properties from here to let grid control width */
}

/* Specific card styles for dashboard */
.dashboard-page .form-card,
.dashboard-page .data-card {
  padding: 30px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: auto; /* Allow grid/flex to define width */
  max-width: 100%; /* Ensure it fits within its container */
}

.dashboard-page .form-card:hover,
.dashboard-page .data-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.dashboard-page .card-title {
  text-align: left;
  font-size: 1.4rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 15px;
  margin-bottom: 25px;
}

/* Data Lists (Vitals & Files) */
.data-list {
  max-height: 300px; /* Limit height and allow scrolling */
  overflow-y: auto;
  padding-right: 10px; /* Space for scrollbar */
}

.data-list::-webkit-scrollbar {
  width: 8px;
}

.data-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.data-list::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.data-list::-webkit-scrollbar-thumb:hover {
  background: #3a7bd5;
}

.record-item,
.file-item,
.doctor-item, /* New */
.consultation-request-item, /* New */
.prescription-item /* New */ {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  font-size: 0.95rem;
  color: #444;
}

.record-item:last-child,
.file-item:last-child,
.doctor-item:last-child, /* New */
.consultation-request-item:last-child, /* New */
.prescription-item:last-child /* New */ {
  border-bottom: none;
}

.record-item span,
.file-item span,
.doctor-item span, /* New */
.consultation-request-item span, /* New */
.prescription-item span /* New */ {
  flex-basis: auto; /* Allow flexible spacing */
  margin-right: 15px;
  margin-bottom: 5px; /* For wrap */
}

.record-item strong {
  color: var(--primary-color);
}

.record-date,
.file-date,
.consultation-date, /* New */
.prescription-date /* New */ {
  font-size: 0.85rem;
  color: #777;
  white-space: nowrap; /* Prevent date from wrapping */
  margin-left: auto; /* Push to right */
}

.file-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  font-weight: 500;
  flex-grow: 1; /* Allow link to take available space */
}

.file-icon {
  font-size: 1.2em;
}

.loading-text,
.error-text {
  text-align: center;
  color: #777;
  padding: 20px;
}

.error-text {
  color: var(--accent-color);
  font-weight: 500;
}

/* Chart Specific Styles */
.chart-container {
  position: relative;
  height: 250px; /* Fixed height for charts */
  width: 100%;
  margin-bottom: 30px;
}

.chart-container h4 {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 15px;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
  padding-bottom: 8px;
}

/* 🚀 NEW UTILITY CLASSES */
.hidden {
  display: none !important;
}

.btn-sm {
  /* For smaller buttons within lists */
  padding: 6px 12px;
  font-size: 0.85rem;
}

.mt-3 {
  margin-top: 15px;
} /* Utility margin classes */
.mt-4 {
  margin-top: 20px;
}
.mb-4 {
  margin-bottom: 20px;
}

/* Doctor Specific UI enhancements */
/* Removed doctor-patient-grid and patient-details-card direct flex properties from here
   as they are now controlled by the parent .dashboard-main grid.
   Added explicit width to cards to ensure they are not squished. */

.patient-lists-card {
    /* min-width and flex rules are now handled by parent grid */
    min-width: 280px; /* Ensure this card has enough width */
}

.patient-details-card {
    /* min-width and flex rules are now handled by parent grid */
    min-width: 350px; /* Ensure this card has enough width */
}

.doctor-welcome-placeholder {
    background: var(--card-background);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-deep);
    padding: 30px;
    margin: 0; /* Override default card margin */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px; /* Give it some height */
    color: #555;
    font-size: 1.1rem;
    line-height: 1.5;
    /* Take full width in its grid cell */
    width: 100%;
}
.doctor-welcome-placeholder h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}


.consultation-request-item {
  background-color: #fffde7; /* Light yellow for pending requests */
  border-left: 5px solid #ffc107;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-light);
}
.consultation-request-item .btn {
  margin-left: 10px;
}

.prescription-item {
  background-color: #e6ffed; /* Light green for prescriptions */
  border-left: 5px solid #50e3c2;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-light);
  flex-direction: column;
  align-items: flex-start;
}
.prescription-item strong {
  font-size: 1.1em;
  color: var(--text-dark);
}
.prescription-item p {
  margin-top: 5px;
  font-size: 0.9em;
  color: #666;
}
.prescription-item .medications {
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}
.prescription-item .medications span {
  display: block;
  margin-bottom: 5px;
}

/* AI Summary styling */
.ai-summary-box {
  background-color: #f7faff;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius-sm);
  padding: 15px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.ai-summary-box h5 {
  color: var(--primary-color);
  margin-bottom: 10px;
  text-align: center;
  font-size: 1.1em;
}

@media (max-width: 768px) {
  .landing-page .glass-container,
  .auth-card {
    padding: 30px 20px;
    margin: 20px;
  }
  .landing-page .app-title {
    font-size: 2.2rem;
  }
  .landing-page .tagline {
    font-size: 1.2rem;
  }
  .landing-page .description {
    font-size: 1rem;
  }
  .landing-page .btn-group {
    flex-direction: column;
    gap: 15px;
  }
  .dashboard-header {
    padding: 15px 20px;
  }
  .dashboard-header .app-title {
    font-size: 1.5rem;
  }
  .dashboard-header #userGreeting {
    display: none; /* Hide on small screens to save space */
  }
  .dashboard-main {
    padding: 0 15px;
    margin: 20px auto;
    grid-template-columns: 1fr; /* Stack on smaller screens */
  }
  /* Ensure cards take full width on smaller screens */
  .patient-lists-card,
  .patient-details-card,
  .doctor-welcome-placeholder {
      width: 100%; /* Take full width on small screens */
      margin: 20px 0; /* Add back vertical margin for stacking */
  }
}

@media (max-width: 480px) {
  .landing-page .logo .icon {
    font-size: 2.5rem;
  }
  .landing-page .app-title {
    font-size: 1.8rem;
  }
  .auth-card {
    padding: 25px 15px;
  }
  .auth-card h2 {
    font-size: 1.8rem;
  }
  .btn {
    font-size: 0.9rem;
    padding: 10px 15px;
  }
}
/* END OF FILE styles.css */
