/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #333;
}

.container {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  max-width: 500px;
  width: 100%;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2rem;
  color: #4a5568;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.header h1 i {
  color: #667eea;
}

.header p {
  color: #718096;
  font-size: 0.9rem;
}

/* Converter Section */
.converter {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Amount Section */
.amount-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.amount-section label {
  font-weight: 600;
  color: #4a5568;
  font-size: 0.9rem;
}

.amount-section input {
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1.1rem;
  transition: border-color 0.3s ease;
}

.amount-section input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Currency Section */
.currency-section {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  position: relative;
}

.currency-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.currency-box label {
  font-weight: 600;
  color: #4a5568;
  font-size: 0.9rem;
}

.select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.3s ease;
}

.select-wrapper:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.select-wrapper img {
  width: 30px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
}

.select-wrapper select {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: #4a5568;
  cursor: pointer;
}

/* Swap Button */
.swap-btn {
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  position: relative;
  z-index: 1;
}

.swap-btn:hover {
  background: #5a67d8;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.swap-btn:active {
  transform: scale(0.95);
}

/* Result Section */
.result-section {
  background: #f7fafc;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rate, .converted {
  font-size: 0.9rem;
  color: #718096;
}

.converted {
  font-size: 1.1rem;
  font-weight: 600;
  color: #4a5568;
}

/* Convert Button */
.convert-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.convert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.convert-btn:active {
  transform: translateY(0);
}

.convert-btn i {
  transition: transform 0.3s ease;
}

.convert-btn:hover i {
  transform: rotate(180deg);
}

/* Responsive Design */
@media (max-width: 600px) {
  .container {
    padding: 20px;
    margin: 10px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .currency-section {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .swap-btn {
    align-self: center;
    margin: 10px 0;
  }

  .swap-btn i {
    transform: rotate(90deg);
  }

  .amount-section input {
    font-size: 1rem;
  }

  .select-wrapper {
    padding: 10px 12px;
  }

  .select-wrapper select {
    font-size: 0.9rem;
  }

  .result-section {
    padding: 15px;
  }

  .converted {
    font-size: 1rem;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 15px;
  }

  .header h1 {
    font-size: 1.3rem;
  }

  .convert-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}