@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #0d6efd;
  --primary-hover: #0b5ed7;
  --primary-light: #e6f0ff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --border-radius: 12px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.5;
}

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

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-info {
  text-align: right;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background-color: var(--primary-light);
}

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

.btn-danger:hover {
  background-color: #dc3545;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Layout Container */
.container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.grid-dashboard {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

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

/* Cards */
.card {
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  margin-bottom: 2rem;
  overflow: hidden;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background-color: var(--bg-light);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-error {
  color: var(--danger-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: none;
}

.invalid .form-control {
  border-color: var(--danger-color);
}

.invalid .form-error {
  display: block;
}

/* Form Wizard (Signup Funnel) */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
  transform: translateY(-50%);
}

.step-indicator {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--bg-white);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.step-indicator.active {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step-indicator.completed {
  border-color: var(--success-color);
  background-color: var(--success-color);
  color: white;
}

.wizard-pane {
  display: none;
}

.wizard-pane.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

.available-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.day-checkbox {
  display: none;
}

.day-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  background-color: var(--bg-white);
}

.day-checkbox:checked + .day-label {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Authentication Page layout */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.auth-container {
  width: 100%;
  max-width: 450px;
}

.auth-container.signup-wide {
  max-width: 600px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-color);
}

/* Interactive Calendar Grid */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.calendar-month-year {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-white);
  overflow: hidden;
}

.calendar-day-name {
  text-align: center;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-light);
}

.calendar-cell {
  height: 130px;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.4rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease-in-out;
}

.calendar-cell:hover:not(.other-month) {
  background-color: var(--primary-light);
  box-shadow: inset 0 0 0 1px var(--primary-color);
  z-index: 5;
}

.calendar-cell:nth-child(7n) {
  border-right: none;
}

.calendar-cell.other-month {
  background-color: #f1f5f9;
  opacity: 0.5;
}

.calendar-date-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.3rem;
  align-self: flex-start;
}

.calendar-cell.today .calendar-date-number {
  color: var(--primary-color);
  background-color: var(--primary-light);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Event Items inside Day Cell */
.events-container {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-right: 2px;
}

/* Scrollbar styling for day cells events-container */
.events-container::-webkit-scrollbar {
  width: 6px;
}

.events-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}

.events-container::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.events-container::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.event-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.event-badge:hover {
  filter: brightness(0.95);
  transform: translateX(1px);
}

.event-badge.mine {
  background-color: #dbeafe;
  color: #1e40af;
  border-left-color: var(--primary-color);
}

.event-badge.pending {
  background-color: #fef3c7;
  color: #92400e;
  border-left-color: #f59e0b;
}

.event-badge.other {
  background-color: #f1f5f9;
  color: #475569;
  border-left-color: #94a3b8;
  cursor: default;
}

/* Profile Info Panel (Payments) */
.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 8px;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
}

.stat-value.status-yes {
  color: var(--success-color);
}

.stat-value.status-no {
  color: var(--danger-color);
}

/* History / List Items */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-white);
  transition: all 0.2s ease;
}

.history-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
  border-color: #cbd5e1;
}

.history-details {
  display: flex;
  flex-direction: column;
}

.history-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.history-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.badge {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

/* Admin Dashboard layout */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 2rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding: 1rem 0.75rem;
  background-color: var(--bg-light);
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  vertical-align: middle;
}

.table tr:hover {
  background-color: #f8fafc;
}

.action-btns {
  display: flex;
  gap: 0.35rem;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  animation: modalSlideIn 0.3s ease-out;
  border: 1px solid var(--border-color);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

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

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

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

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