/* app.css — shared styles for dashboard, login, etc. */

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

/* ---------- Light theme (default) ---------- */
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --muted: #6b7280;
  --text: #0f172a;
  --primary: #2563eb;
  --primary-2: #1e40af;
  --danger: #dc2626;
  --ok: #059669;
  --warn: #d97706;
  --border: #e5e7eb;

  --input-bg: #ffffff;
  --input-border: #d1d5db;
  color-scheme: light;
}

/* ---------- Optional dark theme via .theme-dark on <body> ---------- */
body.theme-dark {
  --bg: #0b0c10;
  --card: #121317;
  --muted: #8b8e98;
  --text: #e8eaed;
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --danger: #ef4444;
  --ok: #10b981;
  --warn: #f59e0b;
  --border: #22242b;

  --input-bg: #0f1116;
  --input-border: var(--border);
  color-scheme: dark;
}

/* ---------- Global ---------- */
body { background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 32px auto; padding: 0 16px; }
.header { display:flex; align-items:center; gap:12px; margin-bottom: 18px; }
.header h1 { margin:0; font-size: 22px; font-weight: 700; }
.header .spacer { flex: 1; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* ---------- Buttons ---------- */
.btn {
  display:inline-flex; align-items:center; gap:8px;
  background: var(--primary); color: #fff; border:0; border-radius:10px;
  padding: 10px 14px; cursor:pointer; font-weight:600;
}
.btn:hover { background: #000; color: #fff; }

.btn-ghost {
  background: transparent; color: var(--text); border:1px solid var(--border);
  border-radius:10px; padding: 10px 14px; cursor:pointer; font-weight:600;
}
.btn-ghost:hover { border-color: var(--muted); }

.icon { width:18px; height:18px; display:inline-block; vertical-align:middle; }

/* ---------- Forms ---------- */
.input, input[type="text"], input[type="email"], input[type="password"], select, textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
}
.input::placeholder { color: var(--muted); }
.form-row { display:flex; gap:12px; flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
}
.table thead th {
  text-align:left; font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing: .04em; color: var(--muted);
  background: #f3f4f6; padding:12px; border-bottom:1px solid var(--border);
}
body.theme-dark .table thead th { background: #101219; }
.table tbody td {
  padding: 12px; border-bottom:1px solid var(--border);
  vertical-align: middle;
}
.table thead th:not(:nth-child(3)) { white-space: nowrap; }
.table tbody td:not(:nth-child(3)) { white-space: nowrap; }

.table tbody tr:hover { background: rgba(0,0,0,.03); }
body.theme-dark .table tbody tr:hover { background: #0e1117; }

/* ---------- Badges / Status ---------- */
.id-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: var(--input-bg); border:1px solid var(--input-border); padding: 4px 8px; border-radius: 8px;
  display:inline-flex; gap:8px; align-items:center;
  white-space: nowrap;
}

.status {
  font-weight:600; padding:4px 8px; border-radius: 999px; font-size:12px;
  display:inline-block; border:1px solid var(--border);
}
.status.draft   { color:#a16207; background: rgba(234,179,8,.15); }
.status.active  { color:#047857; background: rgba(16,185,129,.15); }
.status.archived{ color:#475569; background: rgba(148,163,184,.18); }

/* ---------- Action buttons ---------- */
.actions { display:flex; gap:8px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn {
  background: transparent; border:1px solid var(--border); color: var(--text);
  padding:8px; border-radius:8px; cursor:pointer;
}
.icon-btn:hover { border-color: var(--muted); }
.icon-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Toolbar / Search ---------- */
.toolbar { display:flex; gap:10px; align-items:center; margin-bottom: 12px; }
.muted   { color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { display:flex; gap:8px; align-items:center; justify-content:flex-end; margin-top: 12px; }
.page {
  padding:6px 10px; border:1px solid var(--border); border-radius:8px; color: var(--text);
}
.page.active { background: var(--primary); border-color: var(--primary); color:#fff; }
.page:hover  { border-color: var(--muted); }

/* ---------- Login Page Helpers ---------- */
.center-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.login-card h1 { margin: 0 0 12px; font-size: 22px; }
.login-card .hint { color: var(--muted); margin-bottom: 16px; font-size: 13px; }
.login-card .row { display: grid; gap: 8px; margin-bottom: 12px; }
.login-card label { font-size: 12px; color: var(--muted); }
.login-card .actions { justify-content: flex-end; }

/* ---------- Reset & Global Landing Page ---------- */
body.theme-clinmap {
    --bg-main: #021a19;
    --bg-gradient: radial-gradient(circle at 15% 25%, #0e3d3b 0%, #021a19 100%);
    --text-color: #ffffff;
    --accent: #e65b2d;
    --accent-invert: #ffffff;
    --logo-sub-color: #a5d1cf;
    --btn-text-base: #ffffff;
    --btn-text-hover: #e65b2d;
}

body.theme-withpatients {
    --bg-main: #424A56;
    --bg-gradient: radial-gradient(circle at 15% 25%, #6a778d 0%, #424A56 100%);
    --text-color: #ffffff;
    --accent: #EACA9A;
    --accent-invert: #000000;
    --logo-sub-color: #EACA9A;
    --btn-text-base: #000000;
    --btn-text-hover: #EACA9A;
}

body.landing-page {
    background-color: var(--bg-main);
    background-image: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh; overflow: hidden; position: relative;
}

/* Keep the canvas fixed so the effect does not scroll */
#raysCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.navbar, .hero-section { position: relative; z-index: 10; }

/* ---------- Navbar ---------- */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 40px 8%; }
.logo-text { display: flex; flex-direction: column; font-weight: 800; line-height: 0.85; }
.logo-main { font-size: 28px; letter-spacing: -1px; }
.logo-sub { color: var(--logo-sub-color); }
.nav-links { display: flex; align-items: center; gap: 30px; }

.nav-link-simple {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    display: inline-block;
    transition: transform 0.3s ease;
}
.nav-link-simple:hover { transform: scale(1.1); text-decoration: underline; }

/* ---------- Sliding Invert Buttons ---------- */
.btn-login, .btn-cta {
    display: inline-flex; align-items: center; gap: 10px;
    border: none;
    font-weight: 700; text-transform: uppercase; text-decoration: none; cursor: pointer;
    background-size: 200% 100%;
    background-position: right bottom;
    background-image: linear-gradient(to right, var(--accent-invert) 50%, var(--accent) 50%);
    color: var(--btn-text-base) !important;
    transition: background-position 0.5s ease, color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, background-position, color;
}

.btn-login { padding: 12px 26px; border-radius: 25px; font-size: 13px; }
.btn-cta { padding: 18px 42px; border-radius: 35px; font-size: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }

.icon-svg { width: 18px; height: 18px; }

.btn-login:hover, .btn-cta:hover {
    background-position: left bottom;
    color: var(--btn-text-hover) !important;
    transform: scale(1.08);
}

/* ---------- Hero ---------- */
.hero-section { display: flex; align-items: center; justify-content: space-between; padding: 60px 8%; max-width: 1400px; margin: 0 auto; height: calc(100vh - 150px); }
.hero-content { flex: 1.2; }
.hero-title { font-size: clamp(40px, 6vw, 80px); font-weight: 700; line-height: 1.1; margin-bottom: 30px; }
.hero-description { border-left: 3px solid var(--accent); padding-left: 20px; margin-bottom: 40px; font-size: 18px; color: #e5eef0; }
.hero-visual { flex: 0.8; display: flex; justify-content: flex-end; }

/* ---------- Images ---------- */
.floating-image {
    width: 100%;
    max-width: 400px;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.3));
    animation: floatEffect 6s ease-in-out infinite;
}

/* Static class without animation */
.static-image {
    width: 100%;
    max-width: 400px;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.3));
    animation: none;
}

@keyframes floatEffect {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ---------- Mobile navbar alignment (logo centered + links below) ---------- */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 24px 6%;
        gap: 18px;
        text-align: center;
    }

    .logo-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .btn-login {
        justify-content: center;
    }
}
