/* Base Styles */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #34495e;
  --accent-color: #3498db;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  margin: 0;
  padding: 0;
  background-color: #f5f7fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Styles */
header {
  background-color: var(--primary-color);
  color: white;
  padding: 20px 0;
  margin-bottom: 30px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  margin: 0;
  font-size: 2.2em;
}

.date-info {
  font-style: italic;
  margin-top: 5px;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.3s;
}

nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

nav ul li a.active {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
}

.currency-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.currency-table th,
.currency-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.currency-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 500;
}

.currency-table tr:hover {
  background-color: #f1f1f1;
}

/* Converter Styles */
.converter-container {
  max-width: 600px;
  margin: 0 auto;
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.converter-row {
  display: flex;
  margin-bottom: 20px;
  align-items: center;
}

.converter-row label {
  width: 100px;
  font-weight: 500;
}

.converter-row input,
.converter-row select {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.converter-row select {
  padding: 9px;
}

.converter-actions {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: var(--secondary-color);
}

#swap-currencies {
  background-color: var(--accent-color);
}

.result {
  margin-top: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 4px;
  font-size: 1.2em;
  text-align: center;
}

.rate-info {
  margin-top: 10px;
  font-size: 0.9em;
  color: var(--secondary-color);
  text-align: center;
}

/* Loading and Error States */
.loading {
  text-align: center;
  padding: 40px;
  display: none;
}

.error-message {
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
  display: none;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--accent-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  nav ul {
    margin-top: 15px;
    justify-content: center;
  }

  nav ul li {
    margin: 0 10px;
  }

  .converter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .converter-row label {
    margin-bottom: 5px;
    width: auto;
  }

  .converter-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

.empty-state {
  text-align: center;
  padding: 40px !important;
  color: #7f8c8d;
  font-style: italic;
}

.error-state {
  text-align: center;
  padding: 40px !important;
  color: #e74c3c;
  font-weight: bold;
}

.loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 15px;
}

.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid #3498db;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  display: none;
  padding: 15px;
  margin: 20px 0;
  background-color: #f8d7da;
  color: #721c24;
  border-radius: 4px;
  text-align: center;
}
.warning-message {
  padding: 15px;
  margin-bottom: 20px;
  background-color: #fff3cd;
  color: #856404;
  border-radius: 4px;
  text-align: center;
  transition: opacity 0.5s ease;
}

.empty-state {
  text-align: center;
  padding: 40px !important;
  color: #7f8c8d;
  font-style: italic;
}

.error-message {
  display: none;
  padding: 15px;
  margin: 20px 0;
  background-color: #f8d7da;
  color: #721c24;
  border-radius: 4px;
  text-align: center;
}

/* Search Box Styles */
.search-filter {
  margin: 20px 0;
  padding: 15px 0;
  border-bottom: 1px solid #e0e0e0;
}

.search-box {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

#search-input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#search-input:focus {
  border-color: #4a90e2;
  background-color: white;
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.2);
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #888;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .search-box {
    max-width: 100%;
  }

  #search-input {
    padding: 10px 15px 10px 40px;
    font-size: 14px;
  }
}
