/* SOM — Profesyonel Siber Güvenlik Platformu Tema */
:root {
  /* Tipografi */
  --som-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Consolas", "Monaco", "Liberation Mono", monospace;
  
  /* Renk Paleti - Modern Profesyonel */
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  
  /* Marka Renkleri */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-muted: rgba(37, 99, 235, 0.1);
  
  /* Durum Renkleri */
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-light: #fee2e2;
  --danger-hover: #b91c1c;
  
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-light: #dcfce7;
  
  --warning: #ea580c;
  --warning-bg: #fff7ed;
  --warning-light: #ffedd5;
  
  --info: #0891b2;
  --info-bg: #ecfeff;
  --info-light: #cffafe;
  
  /* Header */
  --header-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --header-border: #1e293b;
  --header-text: #f8fafc;
  --header-muted: #94a3b8;
  
  /* Tasarım Sistemi */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
  
  --wrap-max: 1280px;
  
  /* Animasyonlar */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { 
  -webkit-text-size-adjust: 100%; 
  scroll-behavior: smooth;
}

body {
  font-family: var(--som-font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

a { 
  color: var(--primary); 
  text-decoration: none; 
  transition: all var(--transition-fast);
}

a:hover { 
  color: var(--primary-hover);
  text-decoration: none;
}

/* ==================== HEADER / TOPBAR ==================== */
.layout-top {
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--header-border);
  padding: 0 clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  min-height: 64px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.layout-top__start {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.layout-brand {
  font-weight: 900;
  font-size: 1.375rem;
  letter-spacing: 0.02em;
  color: var(--header-text) !important;
  text-decoration: none !important;
  line-height: 1;
  position: relative;
  transition: all var(--transition-base);
}

.layout-brand:hover {
  color: #fff !important;
  transform: translateY(-1px);
  text-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

.layout-brand--text {
  cursor: default;
}

.layout-brand__sub {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--header-muted);
  opacity: 0.9;
}

.layout-top__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.layout-top__nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

.layout-top__nav a::before {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.layout-top__nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.layout-top__nav a:hover::before {
  transform: scaleX(1);
}

.layout-top__end {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.layout-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.3;
}

.layout-user strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
}

.layout-user__id {
  font-size: 0.75rem;
  color: var(--header-muted);
  font-weight: 500;
}

.layout-top__logout {
  color: var(--header-muted) !important;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.3);
  text-decoration: none !important;
  transition: all var(--transition-fast);
}

.layout-top__logout:hover {
  color: #fff !important;
  border-color: rgba(248, 250, 252, 0.5);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Canlı görüntüleme modu */
.layout-top--live .layout-top__live-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.layout-top__hint {
  font-size: 0.8125rem;
  color: var(--header-muted);
  font-weight: 500;
}

.layout-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  border-radius: 999px;
  transition: all var(--transition-base);
}

.layout-pill--live {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1); }
}

@media (max-width: 900px) {
  .layout-top__nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    border-top: 1px solid var(--header-border);
    padding-top: 8px;
    margin-top: 4px;
  }
}

/* ==================== CONTENT AREA ==================== */
.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 32px) 48px;
  flex: 1;
}

.wrap--wide {
  max-width: 1680px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.2;
}

h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--text);
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
}

.page-lead {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0 0 28px;
  max-width: 56rem;
  line-height: 1.6;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card > strong:first-child {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-secondary);
}

/* ==================== TABLES ==================== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 700;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-strong);
}

tbody tr {
  transition: all var(--transition-fast);
}

tbody tr:hover {
  background: var(--bg-secondary);
  transform: scale(1.005);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2), 0 1px 2px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), 0 2px 4px rgba(37, 99, 235, 0.2);
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-ghost:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-hover) 0%, #991b1b 100%);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  transform: translateY(-2px);
}

/* ==================== FORM ELEMENTS ==================== */
.inp, select.inp, textarea.inp {
  width: 100%;
  max-width: 480px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text);
  transition: all var(--transition-fast);
  line-height: 1.5;
}

.inp:hover, select.inp:hover, textarea.inp:hover {
  border-color: var(--border-strong);
}

.inp:focus, select.inp:focus, textarea.inp:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted), var(--shadow-sm);
  background: #fff;
}

textarea.inp {
  resize: vertical;
  min-height: 100px;
}

label.frm {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 20px 0 8px;
}

label.frm:first-child {
  margin-top: 0;
}

/* ==================== FLASH MESSAGES ==================== */
.flash {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.875rem;
  border: 1px solid transparent;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  animation: slideDown var(--transition-base);
}

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

.flash-ok {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-light);
}

.flash-err {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-light);
}

.flash-info {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info-light);
}

.flash-warn {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-light);
}

/* ==================== FOOTER ==================== */
.som-footer {
  margin-top: auto;
  padding: 20px clamp(20px, 4vw, 32px) 28px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  font-weight: 500;
}

.som-footer__inner {
  max-width: var(--wrap-max);
  margin: 0 auto;
}

/* ==================== AUTH PAGE ==================== */
.som-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(165deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
  position: relative;
  overflow: hidden;
}

.som-auth-body::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.som-auth-card {
  width: 100%;
  max-width: 440px;
  padding: clamp(32px, 6vw, 48px);
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 24px 64px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 10;
  animation: fadeInUp 0.6s ease-out;
}

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

.som-auth-brand {
  text-align: center;
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.som-auth-tagline {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
  line-height: 1.5;
  font-weight: 500;
}

.som-auth-card .inp {
  max-width: none;
}

.som-auth-card .btn-primary {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  font-size: 1rem;
}

/* ==================== CHAT SYSTEM ==================== */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), 0 4px 8px rgba(37, 99, 235, 0.2);
  z-index: 1000;
  transition: all var(--transition-base);
}

.chat-fab:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5), 0 6px 12px rgba(37, 99, 235, 0.3);
}

.chat-fab:active {
  transform: translateY(-2px) scale(1.02);
}

.chat-panel {
  display: none;
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: 70vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  animation: slideInUp 0.3s ease-out;
}

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

.chat-panel.open {
  display: flex;
}

.chat-panel h3 {
  margin: 0;
  padding: 16px 20px;
  background: var(--header-bg);
  color: var(--header-text);
  font-size: 0.9375rem;
  font-weight: 700;
  border-bottom: 1px solid var(--header-border);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-size: 0.875rem;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.chat-msg {
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  animation: fadeIn 0.2s ease-out;
}

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

.chat-msg .who {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.8125rem;
  margin-bottom: 2px;
}

.chat-msg .when {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}

.chat-form {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.chat-form input {
  flex: 1;
  max-width: none;
}

.chat-form button {
  flex-shrink: 0;
}

/* ==================== LIVE VIEW ==================== */
.live-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.1em;
  vertical-align: middle;
  margin-left: 10px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  animation: pulse-live 2s ease-in-out infinite;
}

.live-readonly .step-row {
  opacity: 0.95;
}

.live-readonly .done-yes {
  color: var(--success);
  font-weight: 800;
  font-size: 1.1rem;
}

.live-readonly .done-no {
  color: var(--muted);
  opacity: 0.6;
}

.step-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.step-row:hover {
  background: var(--bg-secondary);
  padding-left: 8px;
  margin: 0 -8px;
}

.step-row:last-child {
  border-bottom: none;
}

/* ==================== UTILITIES ==================== */
.ts {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  
  .card { padding: 18px; }
  
  .btn { padding: 10px 18px; }
  
  .chat-panel {
    right: 16px;
    bottom: 90px;
    width: calc(100vw - 32px);
  }
  
  .chat-fab {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
  }
}

/* Print */
@media print {
  .layout-top,
  .chat-fab,
  .chat-panel,
  .som-footer {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }
}
