:root {
  --primary: #0984E3;
  --primary-hover: #076BBB;
  --secondary: #636E72;
  --accent: #E74C3C;
  --bg-color: #0F172A;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --border-radius: 14px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 2rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, #FFFFFF, #94A3B8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s;
  width: 40px;
  height: 40px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.hidden {
  display: none !important;
}

/* Setup Card */
.setup-card, .map-aesthetic-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: white;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.vehicle-input-group, .location-group {
  display: flex;
  gap: 0.5rem;
}

.icon-btn-small {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  color: white;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn-small:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.duration-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-btn {
  flex: 1;
  min-width: 60px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.preset-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
}

.custom-time-input {
  flex: 2;
  min-width: 100px;
}

.photo-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(9, 132, 227, 0.1);
  border: 1px dashed var(--primary);
  border-radius: 8px;
  cursor: pointer;
  color: var(--primary);
  transition: all 0.2s;
}

.photo-upload-label:hover {
  background: rgba(9, 132, 227, 0.2);
}

.photo-upload-label input {
  display: none;
}

.photo-upload-label svg {
  width: 20px;
  height: 20px;
}

#photo-preview-setup {
  position: relative;
  margin-top: 0.5rem;
}

#setup-photo-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

#remove-photo-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1rem;
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.primary-btn:disabled {
  background: var(--secondary);
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-btn {
  width: 100%;
  padding: 1rem;
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(255,255,255,0.05);
}

.danger-text {
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.mt-4 {
  margin-top: 1rem;
}

/* Active Parking State */
.timer-display {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring__circle {
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#countdown {
  font-size: 2.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.time-warning .progress-ring__circle {
  stroke: var(--accent);
}
.time-warning #countdown {
  color: var(--accent);
  animation: pulse-text 2s infinite;
}

@keyframes pulse-text {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(0,0,0,0.2);
  padding: 0.75rem;
  border-radius: 8px;
}

.detail-icon {
  font-size: 1.25rem;
}

.detail-content {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.detail-value {
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-word;
}

.photo-preview {
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.notes-display {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  border-left: 3px solid var(--primary);
}

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

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
}

.nav-btn.primary { background: var(--primary); color: white; }
.nav-btn.primary:hover { background: var(--primary-hover); }

.nav-btn.secondary { background: rgba(255,255,255,0.1); color: white; }
.nav-btn.secondary:hover { background: rgba(255,255,255,0.2); }

.nav-btn.danger { 
  grid-column: 1 / -1; 
  background: transparent; 
  border: 1px solid var(--accent); 
  color: var(--accent);
  margin-top: 0.5rem;
}
.nav-btn.danger:hover { background: rgba(231, 76, 60, 0.1); }

/* History View */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.history-header h2 {
  font-size: 1.25rem;
}

.spend-tracker {
  background: rgba(9, 132, 227, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(9, 132, 227, 0.3);
  text-align: right;
}

.spend-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.spend-amount {
  font-weight: 700;
  color: var(--primary);
}

.history-filters {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}
.history-list::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}
.history-list::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border-radius: 3px;
}

.history-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1rem;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.history-card-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.history-loc {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.history-car {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.history-cost {
  font-weight: 700;
  color: var(--primary);
}

.empty-history {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-color);
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 350px;
}

.modal-content h3 {
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Utils */
.status-msg {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--primary);
}
