/* =========================================
   1. 기본 설정 (Base Styles)
   ========================================= */
:root {
    --primary-color: #003366; /* BMS Navy */
    --accent-color: #00a8cc;  /* Tech Cyan */
    --text-color: #333;
    --light-bg: #f4f7f6;
    --white: #ffffff;
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-color);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* =========================================
   2. 헤더 및 네비게이션 (Header & Nav)
   ========================================= */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo a {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.navbar { display: flex; }

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    padding: 10px 0;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover { color: var(--accent-color); }

/* --- 드롭다운 메뉴 (수정됨) --- */
.dropdown {
    position: relative;
}

/* 드롭다운 영역 */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%; /* 부모 요소의 바로 아래 */
    left: 0;
    padding-top: 20px; /* 마우스 이동 경로 확보용 투명 여백 */
    margin-top: -10px; /* 살짝 위로 겹치게 */
    z-index: 9999;
    /* 추가: 너비 고정 및 줄바꿈 방지 */
    min-width: 220px;
    white-space: nowrap; 
    border-radius: 4px; /* 둥근 모서리 */
    background-color: transparent; /* 배경은 링크나 내부 div가 담당 */
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 실제 메뉴 박스 디자인 (Index.html 등에서 내부 div를 사용하는 경우) */
.dropdown-inner {
    background-color: #fff;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
    min-width: 200px;
    border-top: 3px solid var(--accent-color);
}

.dropdown-inner a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: black;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.dropdown-inner a:hover {
    background-color: var(--light-bg);
    color: var(--accent-color);
}

/* 추가: .dropdown-inner가 없는 경우(waste_recovery.html 등)에 대한 직접 스타일링 */
.dropdown-content > a {
    display: block;
    background-color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1); /* 그림자 추가 */
}

.dropdown-content > a:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-top: 3px solid var(--accent-color); /* 상단 포인트 컬러 */
}

.dropdown-content > a:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-bottom: none;
}

.dropdown-content > a:hover {
    background-color: var(--light-bg);
    color: var(--accent-color);
}


/* --- 언어 및 모바일 버튼 --- */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#lang-toggle {
    padding: 5px 10px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-color);
}

/* =========================================
   3. 메인 히어로 & 공통 섹션 (Hero & Common)
   ========================================= */
.hero {
    height: 500px;
    background: linear-gradient(135deg, #003366 0%, #001a33 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    margin-top: 80px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 25px;
    margin-top: 20px;
    transition: 0.3s;
}

.btn-primary:hover { background-color: #0088a5; }

.section-padding { padding: 80px 0; }
.bg-light { background-color: var(--light-bg); }
.section-title {
    text-align: center;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.section-subtitle {
    text-align: center;
    margin-bottom: 50px;
    color: #666;
}

/* 그리드 & 카드 */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    cursor: pointer;
}
.card:hover { transform: translateY(-10px); }
.card-icon { font-size: 40px; color: var(--accent-color); margin-bottom: 20px; }

.image-card {
    height: 300px;
    background-color: #2c3e50;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.image-card:hover .overlay { transform: scale(1.05); }
.overlay { text-align: center; transition: transform 0.3s; padding: 20px; }


/* =========================================
   4. Contact 페이지 전용 스타일 (새로 추가됨)
   ========================================= */

/* 상단 배너 이미지 영역 */
.contact-hero {
    margin-top: 80px; /* 헤더 높이만큼 */
    position: relative;
    width: 100%;
    height: 300px; /* 배너 높이 */
    overflow: hidden;
    background-color: #000;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 비율 유지하며 꽉 채우기 */
    opacity: 0.7; /* 텍스트 가독성을 위해 이미지 어둡게 */
}

.hero-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    width: 100%;
}

.hero-text-overlay h1 {
    font-size: 3rem;
    font-weight: 700;
}

/* 폼 컨테이너 디자인 */
.form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

/* 상단 안내 문구 */
.form-intro {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.intro-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.contact-info-box {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.1rem;
    color: #555;
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
}

.info-item i {
    color: var(--accent-color);
    margin-right: 8px;
}

/* 입력 필드 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.required {
    color: #e74c3c;
    margin-left: 3px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    transition: border 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-color);
    outline: none;
}

textarea {
    height: 120px;
    resize: vertical;
}

/* 파일 업로드 영역 */
.file-group {
    background: #fafafa;
    padding: 20px;
    border-radius: 4px;
    border: 1px dashed #ccc;
}

.file-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.file-control {
    padding: 5px;
    background: #fff;
}

.file-info {
    font-size: 0.85rem;
    color: #777;
    margin-top: 5px;
}

/* 버튼 */
.form-footer {
    text-align: center;
    margin-top: 30px;
}

.btn-submit {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 50px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background-color: #002244;
}

/* =========================================
   5. 반응형 (Mobile)
   ========================================= */
@media (max-width: 768px) {
    .hamburger { display: block; }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        height: calc(100vh - 80px);
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        gap: 0;
        overflow-y: auto;
    }

    .nav-menu.active { left: 0; }

    .nav-menu li { width: 100%; }
    .nav-link { 
        display: block; 
        padding: 20px; 
        border-bottom: 1px solid #eee;
    }

    /* 모바일 드롭다운 처리 */
    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        margin-top: 0;
        padding-top: 0;
        min-width: auto; /* 모바일에서는 자동 너비 */
        white-space: normal; /* 모바일에서는 줄바꿈 허용 */
    }
    
    .dropdown:hover .dropdown-content {
        display: block;
    }

    .dropdown-inner {
        box-shadow: none;
        border-top: none;
        background-color: #f9f9f9;
    }
    
    /* 모바일에서 직접 링크 스타일 해제/재설정 */
    .dropdown-content > a {
        background-color: #f9f9f9;
        box-shadow: none;
        border-top: none;
    }
    
    .grid-4, .grid-2 { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2rem; }
    
    /* Contact Form Mobile */
    .form-row { flex-direction: column; gap: 0; }
    .form-group.half { margin-bottom: 20px; }
    .contact-info-box { flex-direction: column; gap: 10px; text-align: center; }
}