/* Unit Converter — page specific overrides (uses variables from main.css) */
.unit-container { 
  padding: 80px 0; 
  min-height: calc(100vh - 200px); 
}

.unit-header { 
  text-align: center; 
  margin-bottom: 40px; 
}

.unit-header h1 { 
  font-size: 2.2rem; 
  margin-bottom: 8px; 
  color: var(--text); 
}

.unit-header p { 
  color: var(--text-light); 
  max-width: 600px;
  margin: 0 auto;
}

.converter-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  margin-bottom: 60px;
}

.category-section, .converter-section {
  display: flex;
  flex-direction: column;
}

.category-card, .converter-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  height: 100%;
}

.category-card h2 {
  margin-bottom: 20px;
  color: var(--text);
  text-align: center;
}

.category-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  color: var(--text);
  text-align: left;
}

.category-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.category-btn.active {
  background: rgba(227,6,19,.1);
  border-color: var(--primary);
  color: var(--primary);
}

.category-btn i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Converter Interface */
.converter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(227,6,19,.2);
}

.converter-header h2 {
  color: var(--text);
  margin: 0;
}

.swap-btn {
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
}

.swap-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.converter-inputs {
  margin-bottom: 30px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.input-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-wrapper input {
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 500;
  transition: var(--transition);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227,6,19,.1);
}

.input-wrapper input:read-only {
  background: #f8fafc;
  color: var(--text-light);
}

.input-wrapper select {
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  background: white;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.input-wrapper select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227,6,19,.1);
}

.equals-sign {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 10px;
}

/* Conversion History */
.conversion-history h3 {
  margin-bottom: 16px;
  color: var(--text);
}

.history-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  background: #f8fafc;
}

.history-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-light);
}

.history-empty i {
  font-size: 2rem;
  margin-bottom: 10px;
  color: #e5e7eb;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  transition: var(--transition);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background: white;
}

.history-conversion {
  font-weight: 500;
  color: var(--text);
}

.history-category {
  font-size: 0.85rem;
  color: var(--text-light);
  background: #e5e7eb;
  padding: 2px 8px;
  border-radius: 12px;
}

#clear-history {
  width: 100%;
}

/* Quick Conversions */
.quick-conversions {
  margin-bottom: 60px;
}

.quick-conversions h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.quick-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.quick-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.quick-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(227,6,19,.1) 0%, rgba(34,197,94,.1) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
}

.quick-card h3 {
  text-align: center;
  margin-bottom: 16px;
  color: var(--text);
}

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

.quick-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.quick-item:last-child {
  border-bottom: none;
}

.quick-item span:first-child {
  font-weight: 500;
  color: var(--text);
}

.quick-item span:last-child {
  color: var(--primary);
  font-weight: 600;
}

/* Info Section */
.info-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.info-section h2 {
  margin-bottom: 16px;
  color: var(--text);
}

.info-section p {
  margin-bottom: 20px;
  line-height: 1.6;
  color: var(--text);
}

.info-section h3 {
  margin: 24px 0 12px;
  color: var(--primary);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.category-info {
  padding: 16px;
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid #e5e7eb;
}

.category-info h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
}

.category-info h4 i {
  color: var(--primary);
}

.category-info p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-light);
}

.info-section ol {
  margin-left: 20px;
  margin-bottom: 16px;
}

.info-section li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--text);
}

.disclaimer {
  background: rgba(227,6,19,.05);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 4px;
  margin-top: 24px;
}

.disclaimer h3 {
  margin-top: 0;
  color: var(--primary);
}

.disclaimer p {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 980px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }
  
  .category-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .category-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    text-align: center;
  }
  
  .input-group {
    flex-direction: column;
    gap: 15px;
  }
  
  .equals-sign {
    transform: rotate(90deg);
    margin: 0;
  }
}

@media (max-width: 640px) {
  .category-card, .converter-card, .info-section {
    padding: 20px;
  }
  
  .unit-header h1 {
    font-size: 1.8rem;
  }
  
  .category-buttons {
    flex-direction: column;
  }
  
  .quick-grid {
    grid-template-columns: 1fr;
  }
  
  .categories-grid {
    grid-template-columns: 1fr;
  }
}