/* File: styles/appointment_history.css */

:root {
  --brand-green: #008878;
  --brand-blue: #005EB8;
  --gray-light: #F7FAFC;
  --gray-lighter: #EDF2F7;
  --gray: #A0AEC0;
  --text: #2D3748;
  --white: #FFFFFF;
  --radius: 12px;
  --shadow: rgba(0, 0, 0, 0.05);
  --max-width: 1200px;
}

/* Reset & base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  background: var(--gray-light);
  font-family: system-ui, sans-serif;
  color: var(--text);
}
a {
  text-decoration: none;
  color: inherit;
}

/* Layout container */
.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 0;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-lighter);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo svg {
  flex-shrink: 0;
}
.nhs-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--brand-blue);
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
.site-nav a {
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}
.site-nav a:hover,
.site-nav .active {
  background: var(--gray-lighter);
  color: var(--brand-green);
}
.btn-portal {
  background: var(--brand-green);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: background 0.2s;
}
.btn-portal:hover {
  background: var(--brand-blue);
}

/* Filter */
.filter-container {
  background: var(--white);
  padding: 1rem;
  margin: 2rem 0;
  border-radius: var(--radius);
  box-shadow: 0 4px 6px var(--shadow);
}
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--gray);
}
.form-group input {
  padding: 0.5rem;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius);
  font-size: 0.875rem;
  width: 150px;
}
.btn-filter {
  background: var(--brand-green);
  color: var(--white);
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}
.btn-filter:hover {
  background: var(--brand-blue);
}

/* History cards grid */
.history-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Individual card */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-lighter);
}
.card-header h3 {
  margin: 0;
  font-size: 1rem;
}
.status-pill {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pill.attended {
  background: #E6FFFA;
  color: var(--brand-green);
}
.status-pill.cancelled {
  background: #FFE6E6;
  color: #D14343;
}
.status-pill.noshow {
  background: #FFF8E6;
  color: #D0A106;
}

.card-body {
  padding: 1rem;
  flex-grow: 1;
}
.card-body .type {
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.card-body .doctor {
  color: var(--gray);
  font-size: 0.875rem;
}

/* Card actions */
.card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--gray-lighter);
}
.btn-outline {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  border: 1px solid var(--brand-green);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--brand-green);
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover {
  background: var(--brand-green);
  color: var(--white);
}
.btn-primary {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  background: var(--brand-green);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: var(--brand-blue);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 1rem 0;
  color: var(--gray);
  font-size: 0.875rem;
  border-top: 1px solid var(--gray-lighter);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .filter-form {
    flex-direction: column;
  }
  .site-nav ul {
    flex-wrap: wrap;
    gap: 1rem;
  }
}
