/* Responsive Design */

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1400px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Medium screens (768px to 1199px) */
@media (max-width: 1199px) {
  .container {
    padding: 15px;
  }

  .header-content {
    padding: 30px;
  }

  .logo h1 {
    font-size: 2rem;
  }

  .card {
    padding: 25px;
  }
}

/* Small screens (tablets - 768px to 1023px) */
@media (max-width: 1023px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .output-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .output-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile screens (up to 767px) */
@media (max-width: 767px) {
  .container {
    padding: 10px;
  }

  .header {
    margin-bottom: 20px;
    padding: 20px 0;
  }

  .header-content {
    padding: 20px;
    border-radius: 15px;
  }

  .logo {
    flex-direction: column;
    gap: 10px;
  }

  .logo h1 {
    font-size: 1.8rem;
    text-align: center;
  }

  .logo i {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .card {
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
  }

  .card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .proposal-form {
    gap: 15px;
  }

  .form-group {
    gap: 6px;
  }

  input,
  textarea,
  select {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .section-divider {
    margin: 25px 0 15px 0;
    padding: 15px 0;
  }

  .section-divider h3 {
    font-size: 1.1rem;
  }

  .form-actions {
    gap: 10px;
    margin-top: 15px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  .output-header h2 {
    font-size: 1.3rem;
  }

  .output-actions {
    gap: 8px;
  }

  .output-actions .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .proposal-content {
    padding: 20px;
    font-size: 0.95rem;
  }

  .loading-state {
    padding: 40px 15px;
  }

  .spinner {
    width: 35px;
    height: 35px;
  }

  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: none;
    margin: 0 10px;
  }

  .footer {
    padding: 20px 0;
    font-size: 0.85rem;
  }
}

/* Extra small screens (up to 480px) */
@media (max-width: 480px) {
  .container {
    padding: 8px;
  }

  .header-content {
    padding: 15px;
  }

  .logo h1 {
    font-size: 1.5rem;
  }

  .logo i {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .card {
    padding: 15px;
  }

  .card h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  input,
  textarea,
  select {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .proposal-content {
    padding: 15px;
    font-size: 0.9rem;
  }

  .saved-proposal-item {
    padding: 15px;
  }

  .saved-proposal-title {
    font-size: 0.95rem;
  }

  .saved-proposal-date {
    font-size: 0.8rem;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .header {
    padding: 15px 0;
    margin-bottom: 15px;
  }

  .header-content {
    padding: 15px;
  }

  .logo {
    flex-direction: row;
    gap: 10px;
  }

  .logo h1 {
    font-size: 1.6rem;
  }

  .card {
    padding: 15px;
    margin-bottom: 15px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card {
    border-width: 0.5px;
  }

  input,
  textarea,
  select {
    border-width: 1px;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .header,
  .footer,
  .form-actions,
  .output-actions {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    margin-bottom: 20px;
  }

  .proposal-content {
    background: white;
    border: 1px solid #ccc;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .spinner {
    animation: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: #e2e8f0;
  }

  .header-content,
  .card {
    background: rgba(45, 55, 72, 0.95);
    color: #e2e8f0;
  }

  .card h2,
  .card h3 {
    color: #e2e8f0;
  }

  input,
  textarea,
  select {
    background: rgba(45, 55, 72, 0.8);
    border-color: #4a5568;
    color: #e2e8f0;
  }

  input:focus,
  textarea:focus,
  select:focus {
    background: #2d3748;
    border-color: #667eea;
  }

  .proposal-content {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .saved-proposal-item {
    background: #2d3748;
    border-color: #4a5568;
  }

  .btn-secondary {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
  }

  .btn-secondary:hover {
    background: #718096;
  }

  .toast {
    background: #2d3748;
    color: #e2e8f0;
  }
}
