/**
 * Design System CSS - tools.roofing.company
 * Complements Tailwind, doesn't conflict
 */

/* ============================================
   CSS VARIABLES (for JS use)
   ============================================ */
:root {
  --color-primary: #f05423;
  --color-primary-dark: #d9451a;
}

/* ============================================
   APP NAVBAR
   ============================================ */
.app-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1000;
}

@media (min-width: 1024px) {
  .app-navbar {
    height: 64px;
  }
}

.app-navbar__container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .app-navbar__container {
    padding: 0 32px;
  }
}

.app-navbar__logo img {
  height: 28px;
  width: auto;
}

@media (min-width: 1024px) {
  .app-navbar__logo img {
    height: 36px;
  }
}

/* ============================================
   HAMBURGER MENU
   ============================================ */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
}

.hamburger__line {
  width: 24px;
  height: 2px;
  background: #20191c;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.hamburger.active .hamburger__line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger__line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (min-width: 1024px) {
  .hamburger {
    display: none;
  }
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  padding: 16px;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 999;
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu__link {
  display: block;
  padding: 12px 16px;
  color: #1f2937;
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.mobile-menu__link:hover {
  background: #fff5f2;
  color: #f05423;
}

/* ============================================
   DESKTOP NAV
   ============================================ */
.desktop-nav {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .desktop-nav__link {
    color: #1f2937;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.15s ease;
  }
  
  .desktop-nav__link:hover {
    color: #f05423;
    background: #fff5f2;
  }
}

/* ============================================
   INPUTS
   ============================================ */
.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: #6b7280;
  font-size: 18px;
  pointer-events: none;
}

.input-field {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 48px;
  font-size: 16px;
  color: #1f2937;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.15s ease;
  -webkit-appearance: none;
}

.input-field.has-suffix {
  padding-right: 48px;
}

.input-field:focus {
  outline: none;
  border-color: #f05423;
  box-shadow: 0 0 0 3px rgba(240, 84, 35, 0.1);
}

.input-suffix {
  position: absolute;
  right: 16px;
  color: #6b7280;
  font-weight: 500;
  pointer-events: none;
}

.input-help {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.select-field {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 16px;
  font-size: 16px;
  color: #1f2937;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;
}

.select-field:focus {
  outline: none;
  border-color: #f05423;
  box-shadow: 0 0 0 3px rgba(240, 84, 35, 0.1);
}

/* Remove icon from select wrapper to avoid conflicts */
.input-wrapper:has(.select-field) .input-icon {
  display: none;
}

.input-wrapper .select-field {
  padding-left: 16px;
}

/* ============================================
   TOOLTIPS
   ============================================ */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-trigger {
  color: #9ca3af;
  cursor: help;
  transition: color 0.15s ease;
}

.tooltip-trigger:hover {
  color: #f05423;
}

.tooltip__content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background: #20191c;
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 10px 15px rgba(0,0,0,0.2);
  max-width: 280px;
  min-width: 200px;
}

.tooltip__content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #20191c;
}

.tooltip:hover .tooltip__content,
.tooltip-trigger:hover + .tooltip__content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

/* ============================================
   STICKY CTA
   ============================================ */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 16px;
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.sticky-cta.visible {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .sticky-cta {
    display: none;
  }
}

/* ============================================
   PITCH VISUAL
   ============================================ */
.pitch-visual {
  width: 100%;
  height: 80px;
  background: #f3f4f6;
  border-radius: 8px;
  position: relative;
  margin-top: 8px;
  overflow: hidden;
}

.pitch-roof {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 40px solid #f05423;
  transition: all 0.3s ease;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.page-content {
  padding-top: 56px;
}

@media (min-width: 1024px) {
  .page-content {
    padding-top: 64px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* ============================================
   RESULTS SECTION
   ============================================ */
.results-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid #e5e7eb;
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
  background: #20191c;
  color: white;
  padding: 48px 0;
  margin-top: 64px;
}

.app-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.15s ease;
}

.app-footer a:hover {
  color: white;
}