/* Mobile LED Calculator Styles */

:root {
  --bg-gradient-start: #01040c;
  --bg-gradient-end: #0b1222;
  --card-bg: rgba(13, 20, 36, 0.96);
  --card-border: rgba(248, 250, 252, 0.08);
  --accent-color: #fbbf24;
  --accent-strong: #f97316;
  --text-primary: #f8fafc;
  --text-muted: #cdd6f6;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

#mobile-app {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 20px;
}

/* Header */
.mobile-header {
  background: rgba(7, 12, 24, 0.96);
  padding: 15px 20px;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.mobile-header .logo-link {
  display: inline-block;
  margin-bottom: 8px;
}

.mobile-header .logo {
  height: 40px;
  width: auto;
}

.mobile-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* 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;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"] {
  display: flex !important;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
  color: #0f172a;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content h2 {
  font-size: 22px;
  margin-bottom: 20px;
  color: #0f172a;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  color: #0f172a;
}

.date-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.date-inputs input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  color: #0f172a;
}

/* Cart Styles */
#cart-items-container {
  margin: 16px 0;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin: 16px 0;
  border-top: 2px solid #e2e8f0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.form-submit {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent-color) 100%);
  color: #0f172a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-submit:active {
  transform: translateY(2px);
}

.button-secondary {
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--accent-strong);
  border: 2px solid var(--accent-strong);
  border-radius: 8px;
  cursor: pointer;
  margin-top: 12px;
}

/* Flatpickr Mobile Adjustments */
.flatpickr-calendar {
  font-size: 14px;
}

.flatpickr-day {
  height: 40px;
  line-height: 40px;
}

/* 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-header {
    position: relative;
  }

  .mobile-content {
    padding: 12px 16px;
  }

  .mobile-card {
    margin-bottom: 12px;
  }
}
