/* CSS Variables for theming */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.2);
  --input-focus: rgba(102, 126, 234, 0.5);
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 20px 0;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.card-icon {
  font-size: 1.4rem;
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Salary Card */
.salary-card {
  border-left: 4px solid #667eea;
}

.salary-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.salary-input {
  flex: 1;
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  text-align: right;
}

.hourly-rate-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(102, 126, 234, 0.15);
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.rate-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.rate-value {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  gap: 8px;
  background: var(--card-bg);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mode-icon {
  font-size: 1rem;
}

/* Calculator Cards */
.calculator-card {
  border-left: 4px solid #4facfe;
}

.calculator-card.hidden {
  display: none;
}

/* Input Fields */
.input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.input-field {
  flex: 1;
  padding: 16px 20px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1.1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-field:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  box-shadow: 0 0 0 4px var(--input-focus);
}

.currency-badge {
  padding: 10px 16px;
  background: var(--primary-gradient);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Results */
.result-container {
  min-height: 100px;
}

.result-placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 30px 20px;
  font-size: 0.95rem;
}

.result-content {
  animation: fadeIn 0.4s ease;
}

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

.result-main {
  text-align: center;
  padding: 20px;
  background: rgba(79, 172, 254, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(79, 172, 254, 0.2);
  margin-bottom: 16px;
}

.result-number {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--success-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 4px;
}

.result-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.result-breakdown {
  display: flex;
  gap: 12px;
}

.breakdown-item {
  flex: 1;
  text-align: center;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.breakdown-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Error state */
.result-error {
  color: #f5576c;
  text-align: center;
  padding: 20px;
  background: rgba(245, 87, 108, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(245, 87, 108, 0.2);
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-note {
  margin-top: 4px;
  font-size: 0.75rem;
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.card:focus-within {
  animation: pulse 0.3s ease;
}

/* Responsive */
@media (max-width: 400px) {
  .mode-btn {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  
  .mode-icon {
    display: none;
  }
  
  .result-breakdown {
    flex-direction: column;
  }
  
  .title {
    font-size: 1.75rem;
  }
}