/* ═══════════════════════════════════════════════════
   MK Araç - Premium Automotive Control Panel
   ═══════════════════════════════════════════════════ */

:root {
  --bg-color: #020617;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-blue: #38bdf8;
  --accent-red: #ef4444;
  --accent-green: #22c55e;
  --glass-bg: rgba(30, 41, 59, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* ── Reset & Base ── */
* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at 50% -20%, rgba(56, 189, 248, 0.15), transparent 60%),
    radial-gradient(circle at 0% 100%, rgba(30, 41, 59, 0.2), transparent 40%);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Header ── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  color: var(--accent-blue);
  width: 24px;
  height: 24px;
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent-blue);
  font-weight: 400;
}

/* ── Status Badge ── */
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.4s ease;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  transition: all 0.4s ease;
}

.status-badge.online {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.status-badge.online .status-dot {
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

.status-badge.scanning {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.status-badge.scanning .status-dot {
  background: var(--accent-blue);
  animation: blink 1s infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ── Main Layout ── */
.main-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 0;
}

/* ── Car Visual ── */
.car-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.radar-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
}

.radar-container.active {
  display: flex;
}

.radar-circle {
  position: absolute;
  border: 1px solid var(--accent-blue);
  border-radius: 50%;
  opacity: 0;
  animation: radar 3s infinite;
}

.radar-circle:nth-child(2) { animation-delay: 1s; }
.radar-circle:nth-child(3) { animation-delay: 2s; }

@keyframes radar {
  0% { width: 0; height: 0; opacity: 0.5; }
  100% { width: 240px; height: 240px; opacity: 0; }
}

.car-icon-wrapper {
  position: relative;
  z-index: 2;
  width: 100px;
  height: 100px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border-radius: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 12px 12px 30px #01040a, -12px -12px 30px #03081e;
  border: 1px solid var(--glass-border);
  transition: border-color 0.5s ease;
}

.car-icon-wrapper.connected {
  border-color: rgba(56, 189, 248, 0.3);
}

.car-main-icon {
  width: 48px;
  height: 48px;
  color: #334155;
  transition: color 0.5s ease;
}

.car-icon-wrapper.connected .car-main-icon {
  color: var(--accent-blue);
}

/* ── Controls ── */
.controls-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.grid-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-premium {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  color: white;
  font-family: 'Outfit', sans-serif;
}

.btn-premium::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
  pointer-events: none;
}

.btn-premium:active:not(.disabled) {
  transform: scale(0.95);
}

.btn-premium.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(1);
}

.btn-premium.blue .icon { color: var(--accent-blue); }
.btn-premium.red .icon { color: var(--accent-red); }
.btn-premium.green .icon { color: var(--accent-green); }

.btn-premium.large {
  padding: 1.25rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.8));
}

.btn-premium.large.active {
  border-color: var(--accent-green);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.2);
}

.btn-premium.large.active .icon {
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* ── Manual Connect Box ── */
.manual-connect-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 10px 20px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease;
}

.manual-connect-box.hidden {
  display: none;
}

.ble-icon {
  color: var(--accent-blue);
  width: 20px;
  height: 20px;
}

.hint-text {
  font-size: 0.8rem;
  font-weight: 600;
}

.small-connect-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
  transition: transform 0.2s ease;
}

.small-connect-btn:active {
  transform: scale(0.95);
}

/* ── Activity Panel ── */
.activity-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 0.75rem 1rem;
  width: 100%;
  flex-shrink: 0;
}

.panel-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-title svg {
  width: 14px;
  height: 14px;
}

.logs-list {
  max-height: 90px;
  overflow-y: auto;
}

.empty-msg {
  font-size: 0.75rem;
  opacity: 0.5;
  text-align: center;
  margin: 0.5rem 0;
}

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  animation: fadeIn 0.3s ease;
}

.log-item:last-child { border-bottom: none; }

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

.log-msg { color: var(--text-primary); }
.log-time { color: var(--text-secondary); font-size: 0.65rem; opacity: 0.6; }
.log-item.success .log-msg { color: var(--accent-green); }
.log-item.error .log-msg { color: var(--accent-red); }

/* ── Footer ── */
footer {
  padding: 0.75rem 0;
  text-align: center;
  opacity: 0.3;
  font-size: 0.65rem;
  flex-shrink: 0;
}
