/* ============================================================
   BASE.CSS — Shared CSS Foundation for Dourathul Hasanath
   All pages import this file for consistent theming & components.
   ============================================================ */

/* ===== CSS Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== CSS Variables (Gold/Dark Theme) ===== */
:root {
  --gold: #d4a853;
  --gold-light: #f0d68a;
  --gold-dark: #b8862d;

  --success: #10b981;
  --success-dim: rgba(16, 185, 129, 0.12);
  --error: #ef4444;
  --warning: #f59e0b;
  --pending: #f59e0b;
  --info: #065fd4;

  --bg-main: #0f0f0f;
  --bg-card: #1f1f1f;
  --bg-input: #282828;

  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;

  --border: #3f3f3f;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);

  --pending-bg: rgba(245, 158, 11, 0.08);
  --pending-border: rgba(245, 158, 11, 0.3);
  --booked-bg: rgba(212, 168, 83, 0.08);
  --booked-border: rgba(212, 168, 83, 0.3);
  --available-bg: rgba(16, 185, 129, 0.06);
  --available-border: rgba(16, 185, 129, 0.25);
  --past-bg: rgba(255, 255, 255, 0.02);
  --past-border: var(--border);
}

/* ===== Base Styles ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Shared Page Header (Gold Gradient) ===== */
.header {
  text-align: center;
  margin-bottom: 32px;
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-radius: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 4s ease-in-out infinite;
}

.header-content {
  position: relative;
  z-index: 1;
}

.logo {
  font-size: 48px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 15px;
  opacity: 0.9;
  font-weight: 400;
}

/* ===== Back Link ===== */
.back-link {
  position: absolute;
  top: 20px;
  left: 20px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
  z-index: 2;
}

.back-link:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: translateX(-4px);
}

/* ===== Buttons (Gold-Themed) ===== */
.btn {
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(212, 168, 83, 0.3);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(212, 168, 83, 0.4);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Spinner ===== */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.2);
  border-top: 3px solid #000;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

.spinner.light {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: white;
}

.spinner.large {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

/* ===== Toast Notifications ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  border-radius: 12px;
  z-index: 2000;
  display: flex;
  align-items: center;
  animation: slideUp 0.3s ease;
  max-width: 90%;
}

.toast.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
  backdrop-filter: blur(10px);
}

.toast.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--error);
  color: var(--error);
  backdrop-filter: blur(10px);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
}

.modal-close {
  width: 36px;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.modal-body {
  padding: 24px;
}

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

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.required {
  color: var(--error);
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group input[type="password"] {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  background: #2a2a2a;
  box-shadow: 0 0 0 4px rgba(212, 168, 83, 0.1);
}

/* ===== Loading & Empty States ===== */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.loading-state p {
  margin-top: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 48px;
  opacity: 0.2;
  margin-bottom: 16px;
  display: block;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-sub {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(212, 168, 83, 0.08);
  border: 1px solid rgba(212, 168, 83, 0.2);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.footer-link:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* ===== Keyframe Animations ===== */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* ===== Malayalam Typography ===== */
[lang="ml"] {
  font-family: "Manjari", "Inter", sans-serif;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .header {
    padding: 24px 16px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-content {
    width: 100%;
  }

  h1 {
    font-size: 24px;
  }

  .logo {
    font-size: 36px;
  }

  .back-link {
    position: static;
    margin-bottom: 16px;
    display: inline-flex;
  }

  .modal {
    max-width: 100%;
    border-radius: 16px;
  }
}
