/* 다 날아 - 드론 부품 견적 및 정밀 호환성 검사 플랫폼 */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background: #0a0a0a;
  color: #fff;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }

/* 넷플릭스 스타일 오프닝 인트로 */
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.intro-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}
.intro-content {
  text-align: center;
}
.intro-subtitle {
  display: block;
  color: #0f62fe;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.5rem;
}
.intro-title {
  color: #fff;
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 30px rgba(15, 98, 254, 0.8);
  animation: netflixZoom 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes netflixZoom {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  30% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* ========================================
   Top Header
   ======================================== */
.top-header {
  background: rgba(10, 10, 10, 0.95);
  border-bottom: 2px solid #0f62fe;
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-badge {
  background: #0f62fe;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  text-transform: uppercase;
}
.logo-area h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}
.logo-area span {
  color: #999;
  font-size: 1rem;
}
.header-actions {
  display: flex;
  gap: 10px;
}

.btn-outline {
  background: transparent;
  border: 1px solid #0f62fe;
  color: #0f62fe;
  padding: 8px 16px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: #0f62fe;
  color: #fff;
}
.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   Main Container
   ======================================== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: flex;
  gap: 20px;
}

/* ========================================
   Catalog Section (Left)
   ======================================== */
.catalog-section {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #333;
}

.category-bg-watermark {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.category-tabs {
  display: flex;
  gap: 8px;
  padding: 16px;
  flex-wrap: wrap;
  z-index: 1;
}

.cat-tab {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #999;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.cat-tab.active {
  background: #0f62fe;
  color: #fff;
  border-color: #0f62fe;
}
.cat-tab:hover:not(.active) {
  border-color: #777;
  color: #fff;
}

.search-bar-wrap {
  padding: 12px 16px;
  background: #0a0a0a;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 1;
}

.search-bar-wrap input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
}
.search-bar-wrap input:focus {
  border-color: #0f62fe;
}
.search-bar-wrap span {
  color: #999;
  font-size: 0.9rem;
  white-space: nowrap;
}

.product-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-height: calc(100vh - 280px - 60px);
}

.product-card {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}
.product-card:hover {
  border-color: #555;
}
.product-card.selected {
  border-color: #0f62fe;
  background: rgba(15, 98, 254, 0.08);
}
.product-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-brand {
  color: #0f62fe;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}
.product-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.spec-tag {
  background: #222;
  color: #ccc;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
}
.product-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #222;
}
.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.btn-select {
  background: #1a1a1a;
  border: 1px solid #444;
  color: #ccc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-select.active {
  background: #0f62fe;
  border-color: #0f62fe;
  color: #fff;
}
.btn-select:hover:not(.active) {
  border-color: #0f62fe;
  color: #0f62fe;
}
.btn-select.active:hover {
  background: #0043ce;
}
.btn-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   Quote Sidebar (Right)
   ======================================== */
.quote-sidebar {
  width: 340px;
  background: #000;
  border-radius: 8px;
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.quote-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.quote-header {
  background: linear-gradient(to right bottom, #0a0f1a, #0a0a0a);
  border-bottom: 2px solid #0f62fe;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.quote-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.badge-count {
  background: #0f62fe;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
}

.selected-list {
  list-style: none;
  padding: 12px;
  margin: 0;
}
.selected-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #111;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid #222;
}
.selected-slot.slot-empty {
  border: 1px dashed #333;
  color: #666;
}
.slot-cat {
  min-width: 60px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #999;
}
.slot-name {
  flex: 1;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ddd;
}
.slot-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f62fe;
}
.qty-btn {
  background: #222;
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.9rem;
}
.qty-btn:hover {
  background: #333;
}
.slot-remove {
  background: transparent;
  color: #666;
  font-size: 1.2rem;
  line-height: 1;
}
.slot-remove:hover {
  color: #0f62fe;
}

.analysis-panel {
  padding: 16px;
  border-top: 1px dashed #333;
}
.analysis-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.metric-item {
  background: #111;
  padding: 10px 12px;
  border-radius: 6px;
}
.metric-label {
  display: block;
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 4px;
}
.metric-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.compat-messages {
  font-size: 0.9rem;
  max-height: 300px;
  overflow-y: auto;
}
.msg-info {
  color: #999;
  margin: 0 0 8px 0;
  line-height: 1.5;
}
.msg-ok {
  color: #22c55e;
  margin: 0 0 8px 0;
  line-height: 1.5;
}
.msg-warn {
  color: #f59e0b;
  margin: 0 0 8px 0;
  line-height: 1.5;
}
.msg-err {
  color: #ef4444;
  margin: 0 0 8px 0;
  line-height: 1.5;
  font-weight: 600;
}

.quote-footer {
  background: #0a0a0a;
  border-top: 1px solid #333;
  padding: 16px;
}
.total-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.total-price-row strong {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f62fe;
}

.btn-primary-large {
  width: 100%;
  background: #0f62fe;
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.2s;
}
.btn-primary-large:hover {
  background: #0043ce;
}

/* ========================================
   Modal (Assemble)
   ======================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}
.modal-header {
  background: #0a0f1a;
  border-bottom: 2px solid #0f62fe;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  color: #999;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 6px;
}
.modal-close:hover {
  color: #fff;
}
.modal-body {
  padding: 20px;
}
.modal-summary {
  background: #080808;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
}
.modal-summary strong {
  color: #0f62fe;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ddd;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: #080808;
  border: 1px solid #333;
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #0f62fe;
}
.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
  }
  .quote-sidebar {
    width: 100%;
    max-height: 500px;
  }
  .product-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .intro-title {
    font-size: 3rem;
  }
}
@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .header-actions {
    width: 100%;
  }
  .header-actions button {
    flex: 1;
    font-size: 0.8rem;
    padding: 8px 12px;
  }
  .product-list {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .modal-card {
    width: 95%;
  }
}
/* ========================================
   로그인 + 내 견적 저장
   ======================================== */
[hidden] { display: none !important; }

.header-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.user-email {
  color: #999;
  font-size: 0.85rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-save {
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 6px;
}

.saved-panel {
  padding: 16px;
  border-top: 1px dashed #333;
}
.saved-panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
}
.saved-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.saved-empty {
  color: #777;
  font-size: 0.85rem;
  line-height: 1.5;
}
.saved-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #111;
  border: 1px solid #222;
  border-radius: 6px;
  margin-bottom: 8px;
}
.saved-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.saved-title {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-meta {
  font-size: 0.75rem;
  color: #999;
}
.saved-load {
  background: #1a1a1a;
  border: 1px solid #0f62fe;
  color: #0f62fe;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.saved-load:hover { background: #0f62fe; color: #fff; }
.saved-delete {
  background: transparent;
  color: #666;
  font-size: 1.2rem;
  line-height: 1;
}
.saved-delete:hover { color: #ef4444; }

.auth-msg { min-height: 1.2em; font-size: 0.85rem; color: #999; margin: 0 0 12px; }
.auth-msg.err { color: #ef4444; }
.auth-msg.ok { color: #22c55e; }
.auth-switch {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: #999;
}
.link-btn {
  background: none;
  color: #0f62fe;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 4px;
}
.link-btn:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .header-actions { justify-content: stretch; }
  .user-email { flex-basis: 100%; max-width: none; }
}
