/* Basic Reset & Universal Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow: hidden;
}

/* Container */
.container {
  background: rgba(33, 33, 33, 0.95);
  backdrop-filter: blur(8px);
  padding: 40px 50px;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 1s ease-out;
}

/* Title */
h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 25px;
  background: linear-gradient(90deg, #ff6a00, #ee0979);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Language Selector */
.lang-select {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
}

/* Inputs & Selects */
input[type=number], select {
  padding: 12px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #444;
  background-color: #1c1c1c;
  color: #fff;
  transition: all 0.3s ease;
}

input[type=number]:focus, select:focus {
  background-color: #2a2a2a;
  border-color: #777;
}

/* Responsive */
@media (max-width: 480px) {
  input[type=number], select {
    width: 100%;
  }
}

/* Button Styling */
.btn {
  margin: 12px 0;
  padding: 12px 22px;
  font-size: 17px;
  background: linear-gradient(145deg, #292929, #1f1f1f);
  border-radius: 14px;
  border: 1px solid #555;
  cursor: pointer;
  color: white;
  position: relative;
  overflow: hidden;
  z-index: 0;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, #ff416c, #ff4b2b, #1cefff, #00ff87);
  background-size: 400%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
  animation: glowing 15s linear infinite;
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  background-color: #333;
  color: #fff;
}

/* Swap button */
#swapBtn {
  padding: 8px 14px;
  font-size: 22px;
}

/* Currency Select Layout */
.currency-selects {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}

/* Quick Buttons */
#quick-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.quick-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #666;
  background-color: #2a2a2a;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  min-width: 110px;
}

.quick-btn:hover {
  background: #444;
  transform: scale(1.05);
}

/* Results */
#result {
  margin: 15px 0;
  font-size: 20px;
  min-height: 32px;
  font-weight: bold;
}

#lastUpdated {
  font-size: 12px;
  color: #aaa;
  user-select: none;
  margin-bottom: 15px;
}

/* Alert Message */
.alert {
  color: #ff4b5c;
  font-weight: bold;
  min-height: 22px;
  margin-top: 12px;
}

/* Chart Canvas */
canvas {
  background: #111;
  border-radius: 14px;
  margin-top: 20px;
  max-width: 100%;
  box-shadow: 0 0 10px #000a;
}

/* Custom Scrollbar */
.container::-webkit-scrollbar {
  width: 8px;
}

.container::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 10px;
}

.container::-webkit-scrollbar-track {
  background: #222;
}

/* Glowing Button Animation */
@keyframes glowing {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Container fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobil uskunalar uchun maxsus tuzatishlar */
@media (max-width: 768px) {
  .container {
    padding: 25px 20px;
    max-width: 100%;
    border-radius: 16px;
  }

  h1 {
    font-size: 22px;
  }

  input[type=number], select {
    font-size: 15px;
    padding: 10px;
    width: 100%;
  }

  .btn {
    font-size: 16px;
    padding: 10px 18px;
  }

  #swapBtn {
    font-size: 20px;
    padding: 6px 10px;
  }

  .currency-selects {
    flex-direction: column;
    gap: 10px;
  }

  #quick-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .quick-btn {
    width: 100%;
    font-size: 15px;
    padding: 10px;
  }

  #result {
    font-size: 18px;
  }

  canvas {
    margin-top: 15px;
  }
}

@media (prefers-color-scheme: light) {
  body {
    background: #f2f2f2;
    color: #000;
  }

  .container {
    background: #fff;
    color: #000;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
  }

  input[type=number], select, .btn, .quick-btn {
    background: #eee;
    color: #000;
    border: 1px solid #ccc;
  }

  .btn:hover, .quick-btn:hover {
    background: #ddd;
  }

  canvas {
    background: #f4f4f4;
  }
}
