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

:root {
  --primary: #2563eb;
  --secondary: #7c3aed;
  --success: #10b981;
  --danger: #ef4444;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --text: #334155;
  --text-light: #64748b;
  --border: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.92);
}

body {
  min-height: 100vh;
  padding: 2rem 1rem;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;

  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;

  background:
    radial-gradient(circle at top left, #2563eb 0%, transparent 35%),
    radial-gradient(circle at bottom right, #7c3aed 0%, transparent 35%),
    #0f172a;

  overflow-x: hidden;
}

.project-back-button {
  transition: all 0.3s ease;
}

.project-back-button:hover {
  transform: translateY(-2px);
}

.title-container {
  text-align: center;
}

.page-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1px;

  background: linear-gradient(135deg, #60a5fa, #818cf8, #c084fc);

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  margin-bottom: 0.3rem;
}

.container {
  width: 100%;
  max-width: 560px;

  padding: 2rem;

  border-radius: 28px;

  background: rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(20px);

  border: 1px solid rgba(255, 255, 255, 0.15);

  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

form {
  display: flex;
  flex-direction: column;
}

form p {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.amount,
.converted-amount,
.chart-container,
.history-section {
  background: var(--card-bg);

  border-radius: 18px;

  padding: 1rem;

  border: 1px solid rgba(255, 255, 255, 0.4);

  margin-top: 1rem;
}

form input,
form select {
  width: 100%;
  outline: none;
}

form input {
  height: 58px;

  border: 2px solid transparent;

  border-radius: 14px;

  padding: 0 1rem;

  font-size: 1rem;

  background: #f8fafc;

  transition: all 0.3s ease;
}

form input:focus {
  border-color: var(--primary);

  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1rem;
  display: none;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

.shake {
  animation: shake 0.3s ease-in-out;
}

.dropdown {
  position: relative;

  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 2rem;

  margin-top: 1.5rem;
}

.dropdown .from,
.dropdown .to {
  flex: 1;
}

.dropdown i {
  position: absolute;

  left: 50%;
  top: 58%;

  transform: translate(-50%, -50%);

  width: 50px;
  height: 50px;

  display: flex;
  justify-content: center;
  align-items: center;

  background: linear-gradient(135deg, var(--primary), var(--secondary));

  color: white;

  border-radius: 50%;

  cursor: pointer;

  z-index: 10;

  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);

  transition: all 0.3s ease;
}

.dropdown i:hover {
  transform: translate(-50%, -50%) rotate(180deg);
}

.select-container {
  height: 58px;

  display: flex;
  align-items: center;

  gap: 0.75rem;

  padding: 0 1rem;

  background: white;

  border: 1px solid var(--border);

  border-radius: 14px;
}

.select-container img {
  width: 28px;
  height: 28px;
  object-fit: cover;
}

.select-container select {
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.msg {
  margin-top: 1.5rem;

  padding: 1rem;

  text-align: center;

  color: white;

  font-size: 1.05rem;
  font-weight: 700;

  border-radius: 16px;

  background: linear-gradient(135deg, var(--primary), var(--secondary));

  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.msg:empty {
  display: none;
}

.converted-amount input {
  background: white;

  color: var(--primary);

  font-size: 1.5rem;
  font-weight: 800;

  text-align: center;
}

.chart-container {
  height: 240px;
}

#historyChart {
  width: 100% !important;
  height: 200px !important;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 1rem;
}

.history-header p {
  margin: 0;
  color: var(--dark);
  font-weight: 800;
}

.clear-history-btn {
  border: none;

  background: linear-gradient(135deg, #ef4444, #dc2626);

  color: white;

  padding: 0.6rem 0.9rem;

  border-radius: 10px;

  cursor: pointer;

  font-size: 0.85rem;
  font-weight: 600;

  transition: all 0.3s ease;
}

.clear-history-btn:hover {
  transform: translateY(-2px);
}

.history-list {
  display: flex;
  flex-direction: column;

  gap: 0.75rem;

  max-height: 280px;

  overflow-y: auto;
}

.history-item {
  background: white;

  border-left: 5px solid var(--primary);

  border-radius: 12px;

  padding: 0.9rem;

  cursor: pointer;

  transition: all 0.3s ease;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.history-item:hover {
  transform: translateY(-4px);

  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.history-item strong {
  color: var(--dark);
}

.history-time {
  color: var(--text-light);
  font-size: 0.75rem;
}

.empty-history {
  text-align: center;
  color: var(--text-light);
  padding: 1rem;
}

.reset-btn {
  width: 100%;

  height: 58px;

  margin-top: 1.5rem;

  border: none;

  border-radius: 16px;

  color: white;

  font-size: 1rem;
  font-weight: 700;

  cursor: pointer;

  background: linear-gradient(135deg, var(--primary), var(--secondary));

  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);

  transition: all 0.3s ease;
}

.reset-btn:hover {
  transform: translateY(-2px);
}

.reset-btn:active {
  transform: scale(0.98);
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

@media (max-width: 768px) {
  .container {
    padding: 1.2rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .dropdown {
    gap: 1rem;
  }

  .dropdown i {
    width: 44px;
    height: 44px;
  }

  .history-header {
    flex-direction: column;
    gap: 0.8rem;
    align-items: stretch;
  }

  .clear-history-btn {
    width: 100%;
  }
}
