/* Responsive LED Calculator Styles */
/* This file combines desktop (styles.css) and mobile (mobile-styles.css) */

/* Import base desktop styles */
@import url('styles.css');

/* Mobile-specific breakpoint: 768px and below */
@media screen and (max-width: 768px) {
  /* Hide desktop layout */
  #app-wrapper {
    display: none !important;
  }

  /* Hide desktop 3D canvas to save resources on mobile */
  #canvas-container canvas {
    display: none !important;
  }

  /* Show mobile layout */
  #mobile-app {
    display: block !important;
  }

  /* Mobile app styles */
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  #mobile-app {
    width: 100%;
    min-height: 100vh;
    padding-bottom: 20px;
  }

  /* Main Content */
  .mobile-content {
    padding: 20px 16px;
    max-width: 600px;
    margin: 0 auto;
  }

  /* Card Styles */
  .mobile-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
  }

  .mobile-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 8px;
  }

  .mobile-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent-color);
  }

  /* Control Sections */
  .control-section {
    margin-bottom: 20px;
  }

  .control-section:last-child {
    margin-bottom: 0;
  }

  /* Collapsible Section Styles */
  .collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
  }

  .collapsible-header:hover {
    color: var(--accent-strong);
  }

  .toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
    margin-left: 8px;
  }

  .collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  /* Input Groups */
  .input-group {
    margin-bottom: 20px;
  }

  .input-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .value-display {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 40px;
    text-align: right;
  }

  /* Mobile Slider Styling */
  .mobile-slider {
    width: 100%;
    height: 40px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
  }

  .mobile-slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--accent-strong), var(--accent-color));
    border-radius: 4px;
  }

  .mobile-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--accent-color);
  }

  .mobile-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--accent-strong), var(--accent-color));
    border-radius: 4px;
  }

  .mobile-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--accent-color);
  }

  /* Info Display */
  .info-display {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 12px;
  }

  .info-display strong {
    color: var(--accent-color);
  }

  /* Visual Representation */
  .visual-card {
    background: linear-gradient(135deg, rgba(10, 15, 29, 0.95), rgba(19, 26, 48, 0.9));
    border-color: rgba(251, 191, 36, 0.2);
  }

  .led-visual-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
  }

  #led-visual-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
  }

  .visual-labels {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .dimension-label {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
  }

  /* Mode Selector */
  .mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .mode-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: var(--text-muted);
  }

  .mode-btn strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
    color: var(--text-primary);
  }

  .mode-btn small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
  }

  .mode-btn.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.3), rgba(251, 191, 36, 0.2));
    border-color: var(--accent-strong);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
  }

  .mode-btn:active {
    transform: scale(0.98);
  }

  /* Pricing Card */
  .pricing-card {
    background: linear-gradient(135deg, rgba(10, 15, 29, 0.95), rgba(19, 26, 48, 0.9));
    border-color: rgba(251, 191, 36, 0.2);
  }

  .price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(248, 250, 252, 0.05);
  }

  .price-item:last-child {
    border-bottom: none;
  }

  .item-label {
    font-size: 14px;
    color: var(--text-muted);
    flex: 1;
  }

  .item-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
  }

  /* Backup Toggle Button */
  .backup-toggle {
    background: rgba(249, 115, 22, 0.2);
    border: 1px solid var(--accent-strong);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
  }

  .backup-toggle.active {
    background: var(--accent-strong);
    color: var(--bg-gradient-start);
  }

  .backup-toggle:active {
    transform: scale(0.98);
  }

  /* Price Total */
  .price-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 0 0;
    margin-top: 8px;
    border-top: 2px solid var(--accent-color);
  }

  .total-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .total-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
  }

  /* CTA Card */
  .cta-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(251, 191, 36, 0.1));
    border-color: var(--accent-strong);
    text-align: center;
  }

  .cta-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent-color) 100%);
    color: #0f172a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
    margin-bottom: 8px;
  }

  .cta-button:active {
    transform: translateY(2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  }

  .cta-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
  }

  /* Powered By */
  .powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    font-size: 12px;
    color: var(--text-muted);
  }

  .powered-by img {
    height: 24px;
    width: auto;
  }

  /* Responsive adjustments for very small screens */
  @media (max-width: 375px) {
    .mobile-content {
      padding: 16px 12px;
    }

    .mobile-card {
      padding: 16px;
    }

    .mode-selector {
      gap: 8px;
    }

    .mode-btn {
      padding: 12px 8px;
    }

    .mode-btn strong {
      font-size: 16px;
    }

    .total-price {
      font-size: 20px;
    }
  }

  /* Landscape mode adjustments */
  @media (orientation: landscape) and (max-height: 500px) {
    .mobile-content {
      padding: 12px 16px;
    }

    .mobile-card {
      margin-bottom: 12px;
    }
  }
}

/* Desktop-only: hide mobile layout by default */
@media screen and (min-width: 769px) {
  #mobile-app {
    display: none !important;
  }

  #app-wrapper {
    display: flex !important;
  }
}
