* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0; 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #222; 
  min-height: 100vh;
}

.view { 
  display: none; 
  min-height: 100vh; 
  padding: 16px; 
  animation: fadeIn 0.3s ease-in;
}

.view.active { 
  display: block; 
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Splash Screen */
.center { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  min-height: 100vh; 
  text-align: center;
  color: white;
}

.logo {
  font-size: 80px;
  margin-bottom: 20px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.center h1 {
  font-size: 2em;
  margin: 10px 0;
  font-weight: 600;
}

.loading {
  color: rgba(255,255,255,0.8);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Cards */
.card { 
  background: white; 
  border-radius: 16px; 
  padding: 24px; 
  margin: 12px auto; 
  max-width: 640px; 
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.card h2 {
  margin: 0 0 20px 0;
  font-size: 1.5em;
  color: #333;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

label { 
  display: block; 
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

input { 
  width: 100%; 
  padding: 14px; 
  border: 2px solid #e0e0e0; 
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input:focus {
  outline: none;
  border-color: #667eea;
}

/* Buttons */
button { 
  width: 100%;
  padding: 14px 20px; 
  border: none; 
  border-radius: 10px; 
  font-size: 16px;
  font-weight: 600; 
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #6c757d;
  color: white;
  width: auto;
  padding: 10px 20px;
  font-size: 14px;
}

.btn-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
}

.btn-large {
  padding: 18px;
  font-size: 18px;
}

button:disabled { 
  background: #ccc !important;
  cursor: not-allowed;
  opacity: 0.6;
  animation: none;
}

/* Header */
.app-header {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.header-content {
  text-align: center;
  margin-bottom: 16px;
}

.header-content h3 {
  margin: 0 0 8px 0;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

/* KREDI GOSTERIMI - KIRMIZI */
.credit-display {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
  font-size: 48px;
  font-weight: 700;
  animation: fadeIn 0.5s ease-in;
}

.credit-amount {
  color: white !important;
}

.credit-label {
  font-size: 24px;
  color: rgba(255,255,255,0.9) !important;
  margin-left: 8px;
}

/* Video */
.video-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin-bottom: 16px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

video { 
  width: 100%; 
  max-height: 400px;
  display: block;
}

/* Messages */
.error { 
  color: #dc3545;
  text-align: center;
  margin-top: 12px;
  font-weight: 500;
}

.scan-result {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-weight: 500;
  font-size: 16px;
  animation: fadeIn 0.3s ease-in;
}

.run-status {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-weight: 500;
  min-height: 24px;
  font-size: 16px;
  animation: fadeIn 0.3s ease-in;
  white-space: pre-line;
}

/* History */
.history-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.history-list li {
  padding: 16px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.history-list li:last-child {
  border-bottom: none;
}

/* Mobile Responsive */
@media (max-width: 480px) { 
  .card { 
    margin: 8px; 
    padding: 16px; 
  }
  
  .credit-display {
    font-size: 36px;
  }
  
  .header-actions {
    flex-direction: column;
  }
  
  .btn-secondary,
  .btn-danger {
    width: 100%;
  }
  
  .video-container {
    min-height: 250px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
  }
  
  .card {
    background: #1e1e1e;
    color: #e0e0e0;
  }
  
  .card h2 {
    color: #e0e0e0;
  }
  
  label {
    color: #b0b0b0;
  }
  
  input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }
  
  .app-header {
    background: #1e1e1e;
  }
  
  .history-list li {
    border-bottom-color: #333;
  }
}
