:root {
  /* Color Palette */
  --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%);
  --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

  --rodaje-color: #667eea;
  --fooh-color: #f5576c;
  --motion-color: #4facfe;
  --edicion-color: #43e97b;

  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);

  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b8a;

  --border-color: rgba(255, 255, 255, 0.1);
  --border-radius: 16px;
  --border-radius-sm: 8px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%);
  background-attachment: fixed;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.main-content {
  grid-column: 1;
}

@media (min-width: 1024px) {
  .container {
    grid-template-columns: 1fr 400px;
  }

  .main-content {
    grid-column: 1;
  }

  .budget-summary {
    grid-column: 2;
    position: sticky;
    top: 2rem;
    align-self: start;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.header h1 {
  font-size: 3rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

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

/* Budget Type Selector */
.budget-type-selector {
  margin-bottom: 3rem;
}

.budget-type-selector h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-primary);
  font-weight: 600;
}

.type-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.type-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.type-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.type-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.type-btn:hover::before {
  opacity: 0.1;
}

.type-btn.active {
  border-color: var(--rodaje-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.type-btn.active::before {
  opacity: 0.15;
}

.type-btn[data-type="rodaje"].active {
  border-color: var(--rodaje-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.type-btn[data-type="fooh"].active {
  border-color: var(--fooh-color);
  box-shadow: 0 0 0 3px rgba(245, 87, 108, 0.2);
}

.type-btn[data-type="motion"].active {
  border-color: var(--motion-color);
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.type-btn[data-type="edicion"].active {
  border-color: var(--edicion-color);
  box-shadow: 0 0 0 3px rgba(67, 233, 123, 0.2);
}

.type-btn .icon {
  font-size: 2rem;
}

.type-btn .label {
  font-weight: 600;
}

/* Country Selector */
.country-selector {
  margin-bottom: 3rem;
}

.country-selector h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-primary);
  font-weight: 600;
}

.country-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.country-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.country-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--success-gradient);
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.country-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.country-btn:hover::before {
  opacity: 0.1;
}

.country-btn.active {
  border-color: #4facfe;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.country-btn.active::before {
  opacity: 0.15;
}

.country-btn .icon {
  font-size: 2.5rem;
}

.country-btn .label {
  font-weight: 600;
  font-size: 1.1rem;
}

.country-btn .currency {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Forms */
.forms-container {
  margin-bottom: 3rem;
}

.budget-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.4s ease-out;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.budget-form h3 {
  font-size: 1.75rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
  font-weight: 600;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.form-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-section h4 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section h4::before {
  content: '';
  width: 4px;
  height: 1.25rem;
  background: var(--primary-gradient);
  border-radius: 2px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input[type="number"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input[type="number"]:focus {
  outline: none;
  border-color: var(--rodaje-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: var(--rodaje-color);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.radio-label {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.radio-label:hover {
  background: var(--bg-card-hover);
  border-color: rgba(102, 126, 234, 0.3);
}

.radio-label input[type="radio"] {
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: var(--rodaje-color);
}

.radio-label input[type="radio"]:checked+span {
  font-weight: 600;
}

.radio-label:has(input[type="radio"]:checked) {
  background: rgba(102, 126, 234, 0.15);
  border-color: var(--rodaje-color);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Unlock Price Button */
.unlock-price-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: var(--border-radius-sm);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.unlock-price-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.unlock-price-btn:active:not(:disabled) {
  transform: translateY(0);
}

.unlock-price-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Readonly input styling */
.form-group input[type="number"]:read-only {
  background: rgba(255, 255, 255, 0.03);
  cursor: not-allowed;
  opacity: 0.7;
}

.conditional-section {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-sm);
  border-left: 3px solid var(--rodaje-color);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    max-height: 1000px;
    transform: translateY(0);
  }
}

/* Budget Summary */
.budget-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.budget-summary h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.summary-content {
  margin-bottom: 1.5rem;
  min-height: 200px;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 1rem;
  font-style: italic;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.summary-item-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-item-value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.summary-category {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--border-radius-sm);
}

.summary-category-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.summary-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--primary-gradient);
  border-radius: var(--border-radius-sm);
  margin-bottom: 1.5rem;
}

.total-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.total-amount {
  font-size: 2rem;
  font-weight: 700;
  color: white;
}

.export-btn {
  width: 100%;
  padding: 1rem 2rem;
  background: var(--secondary-gradient);
  border: none;
  border-radius: var(--border-radius-sm);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

/* Responsive Design */
@media (max-width: 1023px) {
  .container {
    grid-template-columns: 1fr;
  }

  .budget-summary {
    position: static;
    max-height: none;
  }
}

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

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

  .subtitle {
    font-size: 1rem;
  }

  .type-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .type-btn {
    padding: 1rem 0.75rem;
  }

  .type-btn .icon {
    font-size: 1.5rem;
  }

  .budget-form,
  .budget-summary {
    padding: 1.5rem;
  }

  .radio-group {
    flex-direction: column;
  }

  .radio-label {
    min-width: auto;
  }

  .total-label {
    font-size: 1.25rem;
  }

  .total-amount {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.75rem;
  }

  .type-buttons {
    grid-template-columns: 1fr;
  }

  .budget-form h3 {
    font-size: 1.5rem;
  }

  .form-section h4 {
    font-size: 1.1rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .budget-type-selector,
  .forms-container,
  .export-btn {
    display: none;
  }

  .budget-summary {
    position: static;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}