/* ============================================================
   Boğaziçi Film Arşivi — Modern UI
   ============================================================ */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e4e7ee;
  --border-strong: #cfd4de;
  --text: #101828;
  --muted: #667085;
  --brand: #0a2b5c; /* Boğaziçi lacivert */
  --brand-2: #133e82;
  --brand-soft: #eaf0fb;
  --accent: #c8102e; /* Boğaziçi kırmızı */
  --accent-soft: #fdecef;
  --success: #067647;
  --success-soft: #e6f6ee;
  --danger: #b42318;
  --warn: #b54708;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.1);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--brand-2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ============ Header ============ */
.site-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none;
}
.site-header .brand:hover {
  text-decoration: none;
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  /* border: 1px solid rgba(11, 59, 102, 0.2);
  background: rgba(11, 59, 102, 0.08);*/
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}
.brand-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.brand-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}
.site-header nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.site-header nav a {
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.site-header nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}
.site-header nav a.primary {
  background: var(--accent);
}
.site-header nav a.primary:hover {
  background: #a30d26;
}

/* ============ Container ============ */
.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 24px 60px;
}

/* ============ Filters card ============ */
.filters {
  background: var(--surface);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 0.8fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}
.filters .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filters label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filters input,
.filters select,
.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.filters input:focus,
.filters select:focus,
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(19, 62, 130, 0.15);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--brand);
  color: #fff !important;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
  text-decoration: none !important;
}
.btn:hover {
  background: var(--brand-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn-secondary {
  background: #fff;
  color: var(--brand) !important;
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--brand-soft);
}
.btn-accent {
  background: var(--accent);
}
.btn-accent:hover {
  background: #a30d26;
}
.btn-danger {
  background: var(--danger);
}
.btn-danger:hover {
  background: #931b12;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

/* ============ Summary strip ============ */
.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 16px;
  color: var(--muted);
  font-size: 13.5px;
}
.summary strong {
  color: var(--text);
  font-size: 15px;
}

/* ============ Table ============ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-scroll {
  overflow-x: auto;
}
table.films {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.films thead {
  background: var(--surface-2);
}
table.films th {
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.films th a {
  color: var(--muted);
}
table.films th a:hover {
  color: var(--brand);
  text-decoration: none;
}
table.films td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.films tbody tr {
  transition: background 0.12s;
}
table.films tbody tr:hover {
  background: #f8faff;
}
table.films tbody tr:last-child td {
  border-bottom: none;
}
.col-title {
  font-weight: 600;
  color: var(--text);
}
.col-alt {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: #f1f3f7;
  color: #475467;
  border-radius: 6px;
  font-size: 11.5px;
  margin: 1px 3px 1px 0;
}
.odunc-evet,
.odunc-hayir {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.odunc-evet {
  background: var(--success-soft);
  color: var(--success);
}
.odunc-hayir {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ============ Pagination ============ */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 20px 0 0;
  justify-content: center;
}
.pagination a,
.pagination span {
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 13px;
  min-width: 36px;
  text-align: center;
}
.pagination a:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-2);
  text-decoration: none;
}
.pagination .active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.pagination .disabled {
  background: transparent;
  border: none;
  color: var(--muted);
}

/* ============ Forms ============ */
.form {
  background: var(--surface);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.form textarea {
  min-height: 90px;
  resize: vertical;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ============ Alerts ============ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: #a6e0be;
}
.alert-error {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #f5c6ce;
}

/* ============ Page title ============ */
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 18px;
}
.page-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.page-title .sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}

/* ============ Auth ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  padding: 36px 32px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.auth-card .brand-logo {
  margin: 0 auto 14px;
  width: 70px;
  height: 70px;
  font-size: 24px;
  color: #fff;
}
.auth-card h1 {
  text-align: center;
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--text);
}
.auth-card .sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

/* ============ Stats (admin) ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.stat .value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--brand);
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .col-hide-mobile {
    display: none;
  }
  .container {
    padding: 0 14px 40px;
  }
  .site-header {
    padding: 12px 16px;
  }
  .brand-sub {
    display: none;
  }
}
@media (max-width: 560px) {
  .filters {
    grid-template-columns: 1fr;
  }
}

/* --- Cell clipping with hover tooltip --- */
table.films td {
  position: relative;
}
.cell-clip {
  display: block;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.cell-clip-wide {
  max-width: 280px;
}

/* Tooltip that appears on hover when text is clipped */
.cell-clip[data-full]:hover::after {
  content: attr(data-full);
  position: absolute;
  left: 14px;
  top: 100%;
  z-index: 50;
  margin-top: 4px;
  max-width: 420px;
  white-space: normal;
  background: #0f1b3d;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(15, 27, 61, 0.25);
  pointer-events: none;
}
.cell-clip[data-full]:hover::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 100%;
  margin-top: -2px;
  border: 6px solid transparent;
  border-bottom-color: #0f1b3d;
  z-index: 51;
}
