/**
 * CALLME - Mobile-First with Warranty Filter
 * Neon color scheme
 */

:root {
  --black: #0a0a0a;
  --black-light: #141414;
  --white: #ffffff;
  --gray: #666;
  --gray-light: #999;
  --neon-cyan: #00ffff;
  --neon-pink: #ff00ff;
  --neon-green: #39ff14;
  --neon-yellow: #ffff00;
  --neon-orange: #ff6600;
  --neon-purple: #9d4edd;
  --red: #ff3131;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--black-light);
  border-bottom: 1px solid var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0,255,255,0.15);
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 1.2rem; }
.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0,255,255,0.5);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--gray);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulse 2s infinite;
}

.status-dot.demo {
  background: var(--neon-yellow);
  box-shadow: 0 0 8px var(--neon-yellow);
}

@keyframes pulse { 50% { opacity: 0.5; } }

/* Search & Filters */
.search-container {
  padding: 12px 16px;
  background: var(--black-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-container input {
  width: 100%;
  padding: 10px 14px;
  background: var(--black);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.9rem;
  outline: none;
}

.search-container input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0,255,255,0.2);
}

.search-container input::placeholder { color: var(--gray); }

/* Filter Row */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Custom Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--gray-light);
  user-select: none;
}

.checkbox-label input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--neon-purple);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.checkbox-label input:checked + .checkmark {
  background: var(--neon-purple);
  box-shadow: 0 0 10px rgba(157,78,221,0.5);
}

.checkbox-label input:checked + .checkmark::after {
  content: "✓";
  color: var(--white);
  font-size: 0.7rem;
  font-weight: bold;
}

.checkbox-label:hover .checkmark {
  border-color: var(--neon-pink);
}

/* Customer List */
.customer-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--black-light);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.customer-card:active { transform: scale(0.98); }
.customer-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0,255,255,0.15);
}

.customer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--black);
  border: 2px solid var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neon-cyan);
  flex-shrink: 0;
}

.customer-info { flex: 1; min-width: 0; }

.customer-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.customer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.customer-id {
  font-size: 0.6rem;
  color: var(--neon-green);
  font-family: monospace;
}

/* Call Badge */
.call-badge {
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

.call-badge.no-call {
  background: rgba(255,102,0,0.15);
  color: var(--neon-orange);
  border: 1px solid var(--neon-orange);
}

.call-badge.called {
  background: rgba(0,255,255,0.1);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
}

/* Service Type Badge */
.customer-service {
  font-size: 0.6rem;
  font-weight: 500;
}

.customer-service.warranty {
  color: var(--neon-green);
}

.customer-service.out-of-warranty {
  color: var(--neon-purple);
}

.customer-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.customer-status.active { border: 1px solid var(--neon-green); color: var(--neon-green); }
.customer-status.inactive { border: 1px solid var(--red); color: var(--red); }
.customer-status.pending { border: 1px solid var(--neon-yellow); color: var(--neon-yellow); }

/* No Results */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray);
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* Footer */
.footer {
  padding: 10px 16px;
  background: var(--black-light);
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: var(--neon-cyan);
  text-align: center;
  font-weight: 600;
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  padding: 16px;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  width: 100%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--black-light);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  border: 1px solid var(--neon-pink);
  box-shadow: 0 0 30px rgba(255,0,255,0.2);
  transform: scale(0.9);
  transition: transform 0.2s;
}

.modal-overlay.active .modal { transform: scale(1); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--gray);
  border-radius: 50%;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { border-color: var(--neon-pink); color: var(--neon-pink); }

/* Modal Customer */
.modal-customer { text-align: center; margin-bottom: 16px; }

.modal-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--black);
  border: 3px solid var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.modal-name { font-size: 1.2rem; font-weight: 600; margin-bottom: 2px; }
.modal-id { font-size: 0.7rem; color: var(--neon-green); font-family: monospace; margin-bottom: 6px; }

.modal-service-type {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-service-type.warranty {
  background: rgba(57,255,20,0.1);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
}

.modal-service-type.out-of-warranty {
  background: rgba(157,78,221,0.1);
  border: 1px solid var(--neon-purple);
  color: var(--neon-purple);
}

.modal-phone-hidden {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255,0,255,0.1);
  border: 1px solid var(--neon-pink);
  border-radius: 4px;
  font-size: 0.65rem;
  color: var(--neon-pink);
}

/* Call History */
.call-history-section {
  margin-bottom: 16px;
}

.history-title {
  font-size: 0.7rem;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.call-history {
  background: var(--black);
  border-radius: 8px;
  padding: 8px;
  max-height: 120px;
  overflow-y: auto;
}

.no-history {
  text-align: center;
  color: var(--neon-orange);
  font-size: 0.8rem;
  padding: 10px;
}

.history-item {
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--gray);
}

.history-item:last-child { margin-bottom: 0; }

.history-item.connected { border-left-color: var(--neon-green); }
.history-item.missed { border-left-color: var(--red); }

.history-operator {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}

.history-time {
  font-size: 0.65rem;
  color: var(--gray-light);
  margin-bottom: 4px;
}

.history-status { font-size: 0.7rem; }

.connected-badge { color: var(--neon-green); font-weight: 600; }
.missed-badge { color: var(--red); font-weight: 600; }
.duration { color: var(--gray-light); margin-left: 6px; }

/* Call Controls */
.call-controls { margin-bottom: 12px; }

.btn-call {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 2px solid var(--neon-green);
  border-radius: 10px;
  color: var(--neon-green);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.15s;
  box-shadow: 0 0 15px rgba(57,255,20,0.2);
}

.btn-call:hover, .btn-call:active {
  background: var(--neon-green);
  color: var(--black);
  box-shadow: 0 0 25px rgba(57,255,20,0.4);
}

.btn-call:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-icon { font-size: 1.1rem; }

/* Active Call */
.call-active {
  text-align: center;
  padding: 16px;
  background: var(--black);
  border-radius: 10px;
  margin-bottom: 12px;
}

.call-status {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--neon-yellow);
}

.call-status.ringing { animation: blink 1s infinite; }
.call-status.connected {
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(57,255,20,0.5);
  animation: none;
}
.call-status.ended { color: var(--neon-pink); animation: none; }

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

.call-timer {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--neon-cyan);
  text-shadow: 0 0 15px rgba(0,255,255,0.5);
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.btn-end {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 2px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  transition: all 0.15s;
}

.btn-end:hover, .btn-end:active {
  background: var(--red);
  color: var(--white);
}

/* Notes */
.modal-notes {
  padding: 8px 10px;
  background: var(--black);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--gray);
  border: 1px solid rgba(255,255,255,0.05);
  min-height: 30px;
}

.modal-notes:empty::before { content: "Žádné poznámky"; }

/* Toast */
.toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: calc(100% - 32px);
  max-width: 300px;
}

.toast {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--black-light);
  border: 1px solid var(--neon-cyan);
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 8px;
  animation: toastIn 0.3s;
}

.toast.success { border-color: var(--neon-green); }
.toast.error { border-color: var(--red); }

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

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

/* Responsive */
@media (min-width: 600px) {
  .customer-list { padding: 16px; gap: 8px; }
  .customer-card { padding: 14px 16px; }
  .modal { max-width: 400px; padding: 24px; }
}

@media (min-width: 900px) {
  .customer-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .customer-list {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
    margin: 0 auto;
  }
}
