/* 전기삼촌 기본 스타일 */

/* 테마 변수: 브랜드 컬러와 음영을 중앙관리 */
:root {
    --brand-primary: #3b82f6;   /* 파란색 */
    --brand-secondary: #6366f1; /* 보라빛 파랑 */
    --brand-accent: #4ecdc4;    /* 포인트 민트 */
    --text-strong: #1f2937;     /* 진회색 본문 */
    --text-muted: #6b7280;      /* 보조 텍스트 */
    --surface: #ffffff;         /* 카드/표면 */
    --surface-muted: #f4f6fb;   /* 옅은 배경 */
}

/* 전역 설정 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: var(--surface-muted);
    color: var(--text-strong);
    overflow-x: hidden;
    /* 모바일 가로모드에서 주소창 수축으로 인한 100vh 문제 방지 */
    min-height: 100svh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 기본 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 기본 헤더 스타일: 메인 타이틀 푸른색 계열(브랜드 그라데이션) */
header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.25);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    display: inline;
    margin-right: 1rem;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

nav ul li a:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 메인 컨텐츠 */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* 푸터 */
footer {
    background: #0f172a;
    color: #e5e7eb;
    text-align: center;
    padding: 1.2rem 0;
    margin-top: auto;
}

/* 버튼 스타일 */
.cta-button {
    display: inline-block;
    padding: 0.9rem 1.6rem;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.22);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(99, 102, 241, 0.28);
}

/* 기본 채팅 컨테이너 */
.chat-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--surface);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-messages {
    padding: 2rem;
    height: 400px;
    overflow-y: auto;
}

.chat-input-area {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 기본 테이블 스타일 */
#requestTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#requestTable th, #requestTable td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

#requestTable th {
    background-color: #f8f9fa;
    font-weight: 700;
    color: var(--text-strong);
}

#requestTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* 폼 요소 기본 스타일 */
input, textarea, select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 유틸리티 클래스 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* 반응형 유틸리티 */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

/* 모바일 반응형 - 기본 스타일 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    main {
        padding: 1rem 0;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    #requestTable {
        font-size: 0.8rem;
    }
    
    #requestTable th, #requestTable td {
        padding: 0.7rem 0.5rem;
    }
    
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    /* 테이블 가로 스크롤 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 아주 작은 화면 (320px 이하) */
@media (max-width: 320px) {
    .container {
        padding: 0 10px;
    }
    
    .cta-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
    }
    
    #requestTable {
        font-size: 0.7rem;
    }
    
    #requestTable th, #requestTable td {
        padding: 0.5rem 0.3rem;
    }
}

/* chat-header 하위 모든 텍스트를 강제로 흰색으로 */
.chat-header *,
.chat-header h1,
.chat-header .nav-link,
.chat-header .nav-cta {
    color: #fff !important;
}
.chat-header .nav-cta {
    background: rgba(255,255,255,0.15) !important;
}
.chat-header .nav-cta:hover {
    background: rgba(255,255,255,0.3) !important;
}

/* 활성 메뉴 스타일 */
.nav-link.active {
    font-weight: 700 !important;
    color: #fbbf24 !important; /* 황금색 강조 */
    background: rgba(251, 191, 36, 0.15) !important;
    border-radius: 6px;
}
.nav-link.active:hover {
    background: rgba(251, 191, 36, 0.25) !important;
}

/* 모바일 드로어 활성 메뉴 스타일 */
.drawer-link.active {
    font-weight: 700 !important;
    color: #fbbf24 !important; /* 황금색 강조 */
    background: rgba(251, 191, 36, 0.15) !important;
    border-radius: 6px;
}
.drawer-link.active:hover {
    background: rgba(251, 191, 36, 0.25) !important;
}

/* ===== Footer (공통) ===== */
.main-footer { 
  background: #0f172a; 
  color: #cbd5e1; 
  margin-top: 48px; 
}
.main-footer a { 
  color: #cbd5e1; 
  text-decoration: none; 
  transition: color 0.2s ease;
}
.main-footer a:hover { 
  color: #60a5fa; 
  text-decoration: none; 
}

/* 푸터 컨테이너 */
.main-footer .footer-container { 
  padding: 32px 20px 20px; 
  max-width: 1200px; 
  margin: 0 auto; 
}

/* 메인 콘텐츠 영역 */
.main-footer .footer-content { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 32px; 
  margin-bottom: 24px;
}

/* 좌측 메인 섹션 */
.main-footer .footer-main h4 { 
  color: #f1f5f9; 
  margin: 0 0 8px; 
  font-size: 18px; 
  font-weight: 700;
}
.main-footer .footer-main p { 
  margin: 0 0 16px; 
  font-size: 14px; 
  line-height: 1.5; 
  color: #94a3b8;
}

/* CTA 버튼 */
.main-footer .footer-cta .footer-btn {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.main-footer .footer-cta .footer-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #5b21b6 100%);
  transform: translateY(-1px);
  color: white;
}

/* 우측 서비스 섹션 */
.main-footer .footer-services h4 { 
  color: #f1f5f9; 
  margin: 0 0 12px; 
  font-size: 16px; 
  font-weight: 600;
}
.main-footer .service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.main-footer .service-grid a {
  font-size: 13px;
  padding: 4px 0;
  border-radius: 3px;
  transition: padding 0.2s ease;
}
.main-footer .service-grid a:hover {
  padding-left: 8px;
}

/* 하단 정보 영역 */
.main-footer .footer-bottom { 
  border-top: 1px solid rgba(148,163,184,.2); 
  padding-top: 16px; 
  text-align: center;
}
.main-footer .footer-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #94a3b8;
}
.main-footer .footer-bottom p { 
  margin: 0; 
  font-size: 12px; 
  color: #64748b; 
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .main-footer .footer-container { 
    padding: 24px 16px 16px; 
  }
  .main-footer .footer-content { 
    grid-template-columns: 1fr; 
    gap: 20px; 
    margin-bottom: 20px;
  }
  .main-footer .footer-main h4 { 
    font-size: 16px; 
  }
  .main-footer .footer-services h4 { 
    font-size: 14px; 
  }
  .main-footer .service-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .main-footer .footer-info {
    flex-direction: column;
    gap: 4px;
  }
  .main-footer .footer-info span:nth-child(2) {
    display: none; /* 모바일에서 • 구분자 숨김 */
  }
}

/* ===== 공통 헤더 스타일 ===== */
.chat-header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.nav-left.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
}

.logo-link h1 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    color: white;
}

.sub-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    gap: 1.296rem; /* 2rem에서 35.2% 감소 (20% + 10% + 10%) */
    justify-self: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.8rem; /* 1rem에서 20% 감소 */
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-cta.desktop-only {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.nav-cta.desktop-only:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hamburger.mobile-only {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger.mobile-only span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* 햄버거 메뉴 활성화 애니메이션 */
.hamburger.mobile-only.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.mobile-only.active span:nth-child(2) {
    opacity: 0;
}

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

/* 모바일 드로어 메뉴 */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -300px !important;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1000;
    transition: left 0.3s ease !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* iOS Safari 부드러운 스크롤 */
    overscroll-behavior: contain; /* 드로어 내에서 스크롤 제한 */
    display: flex;
    flex-direction: column;
}

.mobile-drawer.active {
    left: 0 !important;
}

.drawer-header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-logo {
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.drawer-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.drawer-menu {
    padding: 1rem 0;
    flex-shrink: 0; /* 메뉴 영역이 축소되지 않도록 */
}

.drawer-link {
    display: block;
    padding: 0.9rem 1.35rem; /* 1rem→0.9rem, 1.5rem→1.35rem (10% 감소) */
    color: #1f2937;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.3s;
    font-weight: 700; /* 기본 볼드 */
}

.drawer-link:hover {
    background: #f8fafc;
}

.drawer-cta {
    display: block;
    margin: 1rem 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* 소셜공유 섹션 */
.drawer-share {
    padding: 1.5rem;
    border-top: 1px solid #f3f4f6;
    background: #f8fafc;
    margin-top: auto; /* 하단에 고정 */
    flex-shrink: 0; /* 공유 영역이 축소되지 않도록 */
}

/* 모바일 터치 스크롤 최적화 */
@media (max-width: 768px) {
    .mobile-drawer {
        touch-action: pan-y; /* 세로 스크롤만 허용 */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 드로어 내부 스크롤 가능 영역 */
    .drawer-menu {
        min-height: auto;
        overflow: visible;
    }
    
    /* 공유 버튼 영역 터치 개선 */
    .share-row {
        touch-action: manipulation; /* 터치 지연 제거 */
    }
}

.drawer-share-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 1rem;
    text-align: center;
}

.share-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
    background: white;
    gap: 0.5rem;
    min-height: 70px;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.share-btn.native { color: #6b7280; }
.share-btn.facebook { color: #1877f2; }
.share-btn.twitter { color: #1da1f2; }
.share-btn.naver { color: #03c75a; }
.share-btn.band { color: #03c75a !important; } /* 네이버와 동일 색상으로 통일, 우선순위 보강 */
.share-btn.naver { color: #03c75a; } /* 네이버 라벨 컬러 보강 */
.share-btn.kakaotalk { color: #3c1e1e; background: #fee500; }

/* 아이콘 스타일 */
.emoji {
    display: inline-block;
    width: 1.2rem;
    text-align: center;
    margin-right: 0.5rem;
}

.icon {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.5rem;
}



/* 소셜 아이콘 개선 - 공식 로고 스타일 */
.icon {
    display: block;
    margin: 0 auto 0.25rem;
}

/* 아이콘 폴백 제거 및 공식 로고 SVG 적용 */
.icon::before { content: none !important; }

.icon {
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border-radius: 6px;
}

/* Native 공유 아이콘 (폴백) */
.icon.native {
    /* 박스 밖으로 위로 올라가는 공유 아이콘 */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-label='Share'><rect x='3' y='10' width='18' height='10' rx='2' fill='%23f3f4f6' stroke='%236b7280' stroke-width='1.5'/><path d='M12 4v9' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round'/><path d='M9 7l3-3 3 3' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* Facebook 공식 컬러/마크 (간단화된 f 마크) */
.icon.facebook {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect width='24' height='24' rx='4' fill='%231877f2'/><path d='M15.5 8.5h-2c-.3 0-.5.2-.5.5v1.5h2.3l-.3 2h-2v6h-2.1v-6H9v-2h1.9V9.3c0-1.7 1-2.8 2.7-2.8h1.9v2z' fill='%23fff'/></svg>");
}

/* X(Twitter) 공식 마크 */
.icon.twitter {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect width='24' height='24' rx='4' fill='%23000000'/><path d='M6 6l12 12M18 6L6 18' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round'/></svg>");
}

/* Naver 로고 (각진 사각형 + 굵은 N) */
.icon.naver {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-label='Naver Logo'><rect width='24' height='24' rx='4' fill='%2303c75a'/><path d='M6 5.5h5.2l6.8 9.6V5.5h2v13h-5.2L8 9.4V18.5H6z' fill='%23ffffff'/></svg>");
}

/* BAND 로고 (브랜드 컬러 + 라운드 더블라인 느낌의 b 심볼) */
.icon.band {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-label='BAND Logo'><rect width='24' height='24' rx='5' fill='%2300c300'/><path d='M8.5 5.75v12.5a.75.75 0 0 0 .75.75h3.6a4.85 4.85 0 0 0 0-9.7H9.25' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/><path d='M9.25 10.3h3.1a2.9 2.9 0 0 1 0 5.8H9.25' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* KakaoTalk 말풍선 마크 (크기 확대 버전) */
.icon.kakaotalk {
    width: 32px;
    height: 32px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' aria-label='KakaoTalk Logo'><rect width='32' height='32' rx='7' fill='%23fee500'/><path d='M16 8.5c-4.6 0-8.1 2.65-8.1 5.95 0 3.25 3.5 5.9 8.1 5.9.45 0 .89-.03 1.31-.09L21.8 24v-3.9c2.54-1.02 4.1-2.75 4.1-4.66 0-3.3-4.3-6.95-9.9-6.95z' fill='%233a1d1d'/></svg>");
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .chat-header .header-content,
    .header-content.nav-container {
        grid-template-columns: auto 1fr auto !important;
        max-width: 100%;
        padding: 0 15px;
    }
    
    .chat-header { padding: 0.6rem 0; }
    .chat-header h1 { font-size: 1.2rem; line-height: 1; }
    .nav-menu { display: none; }
    .nav-cta.desktop-only { display: none; }
    .hamburger.mobile-only { 
        display: flex; 
    }
    .nav-right {
        justify-self: end !important;
    }
    .sub-title { display: none; }
}
