/* ============================================================
   ODTÜ SRM – Online Randevu Sistemi  |  Stil Dosyası
   ============================================================ */

:root {
  --navy:     #003466;
  --blue:     #005eb8;
  --lblue:    #e8f4fc;
  --bg:       #f2f5f9;
  --white:    #ffffff;
  --border:   #d0d8e4;
  --text:     #1a2433;
  --muted:    #6c7a8d;
  --success-bg: #d4edda;
  --success-bd: #b1dfbb;
  --success-tx: #155724;
  --danger-bg:  #f8d7da;
  --danger-bd:  #f1aeb5;
  --danger-tx:  #842029;
  --warn-bg:    #fff3cd;
  --warn-bd:    #ffc107;
  --warn-tx:    #664d03;
  --shadow-sm:  0 1px 3px rgba(0,52,102,.08);
  --shadow-md:  0 4px 16px rgba(0,52,102,.12);
  --radius:     6px;
}

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

body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── HEADER ─────────────────────────────────────────────── */
.srm-header {
  background: var(--navy);
  color: #fff;
  height: 62px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  position: sticky;
  top: 0;
  z-index: 900;
  gap: 16px;
}

.srm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.srm-brand img {
  height: 36px;
  filter: brightness(0) invert(1);
}

.srm-brand-text { line-height: 1.2; }
.srm-brand-text .t1 { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.srm-brand-text .t2 { font-size: 11px; opacity: .75; }

.srm-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Session timer */
.session-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: rgba(255,255,255,.13);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}
.session-timer .t-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  display: inline-block;
}
.session-timer.warn { background: rgba(220,53,69,.35); animation: blink 1s infinite; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.55} }

/* Language switcher */
.lang-sw { display: flex; gap: 3px; }
.lang-sw a {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.65);
  padding: 3px 8px;
  border-radius: 4px;
  transition: all .15s;
}
.lang-sw a.active, .lang-sw a:hover {
  color: #fff;
  background: rgba(255,255,255,.2);
}

/* User */
.hdr-user { font-size: 13px; opacity: .88; white-space: nowrap; }

.btn-hdr {
  font-size: 12px; padding: 5px 13px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.45);
  color: #fff; border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn-hdr:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.8); }

/* ── MAIN ────────────────────────────────────────────────── */
.srm-main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 26px 16px 60px;
}

/* ── TABS ────────────────────────────────────────────────── */
.srm-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 22px;
}

.tab-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 22px;
  font-size: 14px; font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all .15s;
}
.tab-btn:hover:not(.active) { color: var(--navy); background: rgba(0,52,102,.05); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

.tab-badge {
  background: var(--navy); color: #fff;
  border-radius: 10px; font-size: 11px;
  padding: 1px 7px; font-weight: 700;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── CARD ────────────────────────────────────────────────── */
.srm-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 18px;
}

.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--navy);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── FORM ────────────────────────────────────────────────── */
.f-group { margin-bottom: 18px; }

.f-label {
  display: block;
  font-size: 11px; font-weight: 700;
  color: var(--navy);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 6px;
}

.f-select {
  width: 100%; height: 42px;
  padding: 0 36px 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; color: var(--text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%23555' d='M6 7L0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.f-select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,52,102,.1); }
.f-select:disabled { background-color: #f8f9fb; color: var(--muted); cursor: not-allowed; }

/* ── SPINNER ─────────────────────────────────────────────── */
.srm-spin {
  display: none; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px;
  padding: 6px 0;
}
.srm-spin.show { display: flex; }
.spin-ring {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── DATEPICKER ──────────────────────────────────────────── */
#tarih-section { display: none; }
#tarih-section.show { display: block; }

.datepicker-inline { width: 100%; }
.datepicker table { width: 100%; font-size: 14px; font-family: inherit; }
.datepicker table tr td, .datepicker table tr th { padding: 5px 7px; }
.datepicker table tr td.day:hover,
.datepicker table tr td.day.focused { background: var(--lblue); border-radius: 4px; }
.datepicker table tr td.active,
.datepicker table tr td.active:hover {
  background: var(--navy) !important;
  border-radius: 4px !important;
  color: #fff !important;
}
.datepicker table tr td.today { border: 1px solid var(--blue) !important; border-radius: 4px; }
.datepicker table tr td.disabled { color: #ccc; }

/* ── TIME SLOTS ──────────────────────────────────────────── */
#sira-section { display: none; }
#sira-section.show { display: block; }

.slot-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}

.slot-btn {
  padding: 8px 20px;
  border: 1.5px solid var(--border);
  background: #fff; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  color: var(--text); font-family: inherit;
}
.slot-btn:hover  { border-color: var(--navy); color: var(--navy); background: var(--lblue); }
.slot-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── BOOK BUTTON ─────────────────────────────────────────── */
#btn-randevu-al {
  display: none;
  margin-top: 22px;
  padding: 12px 32px;
  font-size: 15px; font-weight: 700;
  background: var(--navy); border: none;
  color: #fff; border-radius: var(--radius);
  cursor: pointer; transition: background .15s;
  font-family: inherit;
  align-items: center; gap: 8px;
}
#btn-randevu-al.show { display: inline-flex; }
#btn-randevu-al:hover { background: var(--blue); }
#btn-randevu-al:disabled { background: var(--muted); cursor: not-allowed; }

/* ── ALERTS ──────────────────────────────────────────────── */
.srm-alert { display: none; padding: 11px 15px; border-radius: var(--radius); font-size: 13px; margin-top: 12px; }
.srm-alert.show { display: flex; align-items: flex-start; gap: 9px; }
.srm-alert i { margin-top: 1px; flex-shrink: 0; }
.srm-alert.warning { background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-tx); }
.srm-alert.danger  { background: var(--danger-bg); border: 1px solid var(--danger-bd); color: var(--danger-tx); }
.srm-alert.info    { background: #d1ecf1; border: 1px solid #bee5eb; color: #0c5460; }

/* ── RESULT ──────────────────────────────────────────────── */
.srm-result {
  display: none;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 4px;
}
.srm-result.show    { display: block; }
.srm-result.success { background: var(--success-bg); border: 1px solid var(--success-bd); }
.srm-result.error   { background: var(--danger-bg);  border: 1px solid var(--danger-bd); }

.res-title {
  font-size: 15px; font-weight: 700;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.srm-result.success .res-title { color: var(--success-tx); }
.srm-result.error   .res-title { color: var(--danger-tx); }

.res-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  font-size: 13px;
}
.res-grid dt { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.res-grid dd { font-weight: 500; }
.res-grid dd strong { color: var(--navy); font-size: 15px; }

/* ── APPOINTMENT TABLE ───────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }

.srm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.srm-table thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 11px 14px;
  white-space: nowrap;
}
.srm-table thead th:first-child { border-radius: var(--radius) 0 0 0; }
.srm-table thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
.srm-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.srm-table tbody tr:last-child td { border-bottom: none; }
.srm-table tbody tr:hover td { background: var(--lblue); }
.date-cell { font-weight: 600; white-space: nowrap; }

/* Cancel button */
.btn-cancel {
  padding: 5px 13px; font-size: 12px; font-weight: 600;
  background: transparent;
  border: 1.5px solid #dc3545;
  color: #dc3545; border-radius: var(--radius);
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.btn-cancel:hover { background: #dc3545; color: #fff; }

/* Empty state */
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state i { font-size: 44px; display: block; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 14px; }

/* ── SESSION MODAL ───────────────────────────────────────── */
.srm-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 1500;
  align-items: center; justify-content: center;
}
.srm-overlay.show { display: flex; }

.srm-modal {
  background: #fff; border-radius: 10px;
  padding: 36px 32px;
  max-width: 400px; width: 92%;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  text-align: center;
}
.modal-icon {
  width: 60px; height: 60px;
  background: var(--warn-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  font-size: 26px; color: #856404;
}
.srm-modal h4 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.srm-modal p  { color: var(--muted); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
.modal-count  { font-size: 38px; font-weight: 800; color: var(--navy); margin-bottom: 22px; font-variant-numeric: tabular-nums; }
.btn-extend {
  width: 100%; padding: 13px;
  background: var(--navy); color: #fff; border: none;
  border-radius: var(--radius); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .15s; font-family: inherit;
}
.btn-extend:hover { background: var(--blue); }

/* ── TOAST ───────────────────────────────────────────────── */
#toast {
  display: none; position: fixed;
  bottom: 28px; right: 24px;
  padding: 13px 22px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  z-index: 2000;
  box-shadow: var(--shadow-md);
  max-width: 360px;
  animation: fadeUp .3s ease;
}
#toast.show { display: block; }
#toast.success { background: var(--success-bg); border: 1px solid var(--success-bd); color: var(--success-tx); }
#toast.danger  { background: var(--danger-bg);  border: 1px solid var(--danger-bd);  color: var(--danger-tx); }
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── LOGIN / NO-ACCESS PAGES ─────────────────────────────── */
.srm-center {
  min-height: calc(100vh - 62px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.srm-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 52px 44px;
  max-width: 480px; width: 100%;
  text-align: center;
}
.box-icon { font-size: 54px; color: var(--navy); margin-bottom: 22px; }
.srm-box h2 { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.srm-box p  { color: var(--muted); font-size: 14px; margin-bottom: 28px; line-height: 1.7; }

.btn-login {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 30px;
  background: var(--navy); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: background .15s; font-family: inherit;
}
.btn-login:hover { background: var(--blue); color: #fff; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .srm-main { padding: 16px 10px 50px; }
  .srm-card { padding: 16px; }
  .tab-btn  { padding: 9px 13px; font-size: 13px; }
  .srm-header { height: 54px; }
  .srm-brand-text .t2 { display: none; }
  .hdr-user { display: none; }
  .session-timer { padding: 3px 9px; font-size: 12px; }
}
@media (max-width: 420px) {
  .srm-header-right { gap: 8px; }
  .lang-sw { display: none; }
  .srm-box { padding: 36px 20px; }
}

/* ── BRAND LİNK ──────────────────────────────────────────── */
a.srm-brand { text-decoration: none; color: #fff; }
a.srm-brand:hover .t1 { opacity: .85; }

/* ── ALINMIŞ (TAKEN) SLOT ────────────────────────────────── */
.slot-btn.taken {
  background: #e0e5ec;
  color: #a0aab7;
  cursor: not-allowed;
  opacity: .55;
  pointer-events: none;
  text-decoration: line-through;
}

/* ── SONUÇ POPUP MODAL ───────────────────────────────────── */
.srm-result-modal { border-radius: 12px; overflow: hidden; border: none; }
.srm-result-modal .modal-body { padding: 32px 28px 16px; }
.srm-result-modal .modal-footer {
  border-top: 1px solid var(--border);
  padding: 14px 28px;
  justify-content: center;
}

.srm-popup-ok,
.srm-popup-err { text-align: center; }

.srm-popup-icon {
  font-size: 52px;
  color: var(--success-tx);
  margin-bottom: 12px;
}
.srm-popup-icon.err { color: var(--danger-tx); }

.srm-popup-ok h4,
.srm-popup-err h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.srm-popup-err p {
  color: var(--danger-tx);
  font-size: 14px;
  margin: 0;
}

.srm-popup-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  text-align: left;
  margin-top: 8px;
}
.srm-popup-grid dt { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.srm-popup-grid dd { margin: 0; font-size: 14px; color: var(--text); }

.btn-modal-ok {
  padding: 10px 36px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.btn-modal-ok:hover { background: var(--blue); }
.btn-modal-gray { background: #6c757d; }
.btn-modal-gray:hover { background: #5a6268; }
.btn-modal-red  { background: #c0392b; }
.btn-modal-red:hover  { background: #a93226; }
