/* responsive.css - Responsive Design and Media Queries */

/* Tablet and mobile responsive design */
@media (max-width: 768px) {
  #smartfence-embed-root .app-header {
    padding: 1rem; /* Simplified padding */
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    padding-top: calc(1rem + constant(safe-area-inset-top, 0px));
  }
  
  #smartfence-embed-root .nav-brand {
    gap: 0.5rem; /* Reduced gap on mobile */
  }

  #smartfence-embed-root .logo-icon2 {
    height: 34px; /* Reduced size for mobile */
  }

  #smartfence-embed-root .logo-text2 {
    font-size: 1.25rem; /* Reduced size for mobile */
  }

  #smartfence-embed-root .logo-subtitle2 {
    font-size: 0.9rem;
  }
  
  #smartfence-embed-root .chat-interface {
    width: 100%;
    min-width: 0;
  }
  
  #smartfence-embed-root .chat-container {
    width: 100%;
    min-width: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin: 0;
  }
  
  #smartfence-embed-root .message {
    max-width: 95%; /* Even wider on mobile to use available space */
    min-width: 0;
    word-wrap: break-word;
  }
  
  #smartfence-embed-root .message-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0.425rem 0.675rem;
    font-size: 0.8125rem;
  }
  
  #smartfence-embed-root .chat-messages {
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(0.75rem + constant(safe-area-inset-bottom, 0px));
  }
  
  #smartfence-embed-root .welcome-message {
    padding: 1rem 1rem; /* Reduced padding on mobile */
  }
  
  #smartfence-embed-root .welcome-message h2 {
    font-size: 1.75rem; /* Scaled down for mobile */
  }
  
  #smartfence-embed-root .welcome-message p {
    font-size: 1rem; /* Scaled down for mobile */
  }
  
  #smartfence-embed-root .capabilities {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  #smartfence-embed-root .capability-item {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
  
  #smartfence-embed-root .question-container {
    padding: 1.5rem 1rem; /* Reduced padding on mobile */
  }
  
  #smartfence-embed-root .question-container h4 {
    font-size: 1.25rem; /* Scaled down for mobile */
  }
  
  #smartfence-embed-root .options-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  #smartfence-embed-root .fence-types-showcase .fence-type-selection .options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  #smartfence-embed-root .fence-types-showcase .fence-type-selection .option-content {
    padding: 0.75rem;
  }
  
  #smartfence-embed-root .fence-types-showcase .fence-type-selection .option-label {
    font-size: 1rem;
  }
  
  #smartfence-embed-root .fence-types-showcase .fence-type-selection .option-description {
    font-size: 0.93rem;
  }
  
  #smartfence-embed-root .input-area {
    padding: 1rem; /* Simplified padding */
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 20px));
    padding-bottom: calc(1rem + constant(safe-area-inset-bottom, 20px));
    background-color: var(--bg-secondary);
    border-top: 2px solid var(--primary-color);
  }
  
  #smartfence-embed-root .input-container {
    padding: 0.625rem; /* Reduced padding */
    margin-bottom: env(safe-area-inset-bottom, 10px);
    margin-bottom: constant(safe-area-inset-bottom, 10px);
  }
  
  #smartfence-embed-root .input-container input {
    font-size: 0.9375rem; /* Slightly smaller on mobile */
    padding: 0.375rem 0;
    font-size: 16px !important; /* Prevent iOS zoom */
  }
  
  #smartfence-embed-root .btn {
    padding: 0.625rem 1.25rem; /* Reduced padding */
    font-size: 0.9375rem; /* Slightly smaller */
  }
  
  #smartfence-embed-root .btn-primary {
    padding: 0.625rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
  
  #smartfence-embed-root .btn-voice {
    padding: 0.625rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
  
  #smartfence-embed-root .btn-secondary {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
  }
  
  #smartfence-embed-root .quick-actions {
    gap: 0.375rem;
    margin-bottom: 0.5rem;
  }
  
  #smartfence-embed-root .quick-action {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* Mobile estimate styles */
  #smartfence-embed-root .estimate-result {
    padding: 1rem;
    margin: 0.75rem 0;
  }
  
  #smartfence-embed-root .estimate-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
  }
  
  #smartfence-embed-root .estimate-total {
    width: 100%;
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-sm);
  }
  
  #smartfence-embed-root .total-amount {
    font-size: 1.75rem;
  }
  
  #smartfence-embed-root .specifications-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  #smartfence-embed-root .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  #smartfence-embed-root .service-card {
    padding: 1.25rem;
  }
  
  #smartfence-embed-root .service-card i {
    font-size: 2rem;
  }
  
  #smartfence-embed-root .style-cards {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
  }
  
  #smartfence-embed-root .style-card {
    padding: 1rem;
  }
  
  #smartfence-embed-root .fence-benefits {
    padding: 1.25rem;
  }
  
  .fence-info,
  #smartfence-embed-root .services-info {
    padding: 1rem;
  }

  #smartfence-embed-root .option-card.with-image {
    min-height: 200px;
  }
  
  #smartfence-embed-root .option-card.with-image .fence-type-image {
    height: 120px;
  }
  
  #smartfence-embed-root .option-card.with-image .option-content {
    padding: 0.75rem;
  }
  
  #smartfence-embed-root .option-card.with-image .option-header {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Mobile modal adjustments */
  #smartfence-embed-root .modal-container {
    max-width: 95%;
    margin: 0.5rem;
  }
  
  .modal-header,
  .modal-content,
  #smartfence-embed-root .modal-actions {
    padding: 1rem;
  }
  
  #smartfence-embed-root .modal-actions {
    flex-direction: column;
  }
  
  #smartfence-embed-root .modal-actions .btn {
    width: 100%;
    min-width: auto;
  }
  
  /* NEW: Prevent iOS zoom on focus */
  #smartfence-embed-root input, #smartfence-embed-root textarea, #smartfence-embed-root select {
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  #smartfence-embed-root .nav-brand {
    gap: 0.375rem;
  }

  #smartfence-embed-root .logo-text2 {
    font-size: 1.125rem;
  }

  #smartfence-embed-root .logo-subtitle2 {
    font-size: 0.85rem;
  }
  
  #smartfence-embed-root .chat-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin: 0;
  }
  
  #smartfence-embed-root .welcome-message h2 {
    font-size: 1.5rem;
  }
  
  #smartfence-embed-root .welcome-message p {
    font-size: 0.9375rem;
  }

  #smartfence-embed-root .fence-types-showcase .fence-type-selection .options-grid {
    grid-template-columns: repeat(2, 1fr); /* Keep 2 columns even on smallest screens */
    gap: 0.5rem;
  }
  
  #smartfence-embed-root .fence-types-showcase .fence-type-selection .option-content {
    padding: 0.5rem;
  }
  
  #smartfence-embed-root .fence-types-showcase .fence-type-selection .option-label {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
  
  #smartfence-embed-root .fence-types-showcase .fence-type-selection .option-description {
    font-size: 0.93rem;
    line-height: 1.2;
  }
  
  #smartfence-embed-root .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  #smartfence-embed-root .btn-primary {
    padding: 0.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
  }
  
  #smartfence-embed-root .btn-voice {
    padding: 0.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
  }

  #smartfence-embed-root .option-card.with-image {
    min-height: 180px;
  }
  
  #smartfence-embed-root .option-card.with-image .fence-type-image {
    height: 100px;
  }
  
  #smartfence-embed-root .option-card.with-image .option-content {
    padding: 0.5rem;
  }
  
  #smartfence-embed-root .option-card.with-image .option-label {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
  
  #smartfence-embed-root .option-card.with-image .option-description {
    font-size: 0.93rem;
    line-height: 1.2;
  }

  /* Small mobile estimate styles */
  #smartfence-embed-root .estimate-result {
    padding: 0.75rem;
  }
  
  #smartfence-embed-root .specifications-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  #smartfence-embed-root .spec-item {
    padding: 0.75rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  #smartfence-embed-root .spec-item i {
    font-size: 1.25rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  
  #smartfence-embed-root .spec-details {
    display: flex;
    flex-direction: column;
  }
  
  #smartfence-embed-root .total-amount {
    font-size: 1.5rem;
  }
  
  #smartfence-embed-root .style-cards {
    grid-template-columns: 1fr;
  }
  
  #smartfence-embed-root .service-card {
    padding: 1rem;
  }
  
  /* NEW: Extra padding for very small screens */
  #smartfence-embed-root .input-area {
    padding: 1rem 0.75rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 25px));
    padding-bottom: calc(1rem + constant(safe-area-inset-bottom, 25px));
  }
  
  #smartfence-embed-root .input-container {
    margin-bottom: env(safe-area-inset-bottom, 15px);
    margin-bottom: constant(safe-area-inset-bottom, 15px);
  }
}