/* ========== 공통 ========== */
* { box-sizing: border-box; }
body {
    font-family: 'Noto Sans', sans-serif;
    margin: 0;
    /* background: #f9f9f9; */
	background-image: url('https://www.hexagons.kr/static/images/main_img2.png');
	background-repeat: no-repeat;
	background-position: center;
	height: 100vh;
	background-size: cover;
    /* color: #333; */
}
a { color: inherit; text-decoration: none; }

/* ========== 헤더 / 네비 ========== */
header { background:#003366; color:white; }
.navbar {
    display: flex;
    justify-content: space-between; /* 로고 왼쪽 / 메뉴 & 햄버거 오른쪽 */
    align-items: center;
    padding: 10px 20px;
    background: #003366;
    color: white;
}
.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: bold;
}
.menu-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    margin-left: 20px;
}
.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}
.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px;
}


.nav-links li a { color:white; padding:8px 12px; border-radius:6px; display:inline-block; transition:background .2s; }
.nav-links li a:hover { background: rgba(255,255,255,0.08); }

/* ========== main / card ========== */
main { padding:28px 16px; max-width:1100px; margin:0 auto; }
.card { background:white; border-radius:10px; padding:18px; box-shadow:0 6px 18px rgba(0,0,0,0.06); margin-bottom:18px; }

/* ========== footer ========== */
footer { background:#003366; color:white; text-align:center; padding:14px 10px; }
.footer-logo { text-decoration:none; color:inherit; }
.footer-logo:hover { text-decoration:none; }

/* ========== Contact ========== */
.contact-header { text-align:center; margin-bottom:18px; }
.contact-title { font-size:1.6rem; color:#003366; margin-bottom:6px; }
.contact-subtitle { color:#555; margin-bottom:10px; }

#contact-form { display:flex; flex-direction:column; gap:12px; max-width:720px; margin:0 auto; }
#contact-form input, #contact-form textarea {
    width:100%; padding:12px; border-radius:8px; border:1px solid #d0d0d0; font-size:14px;
}
#contact-form textarea { min-height:140px; resize:vertical; }
#contact-form button { padding:12px; border-radius:8px; border:none; background:#003366; color:white; cursor:pointer; font-size:15px; }
#contact-form button:hover { background:#0055aa; }
.form-message { margin-top:10px; text-align:center; }

/* ========== Admin ========== */
.admin-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.admin-header form { display:flex; gap:0; flex:1; min-width:180px; max-width:360px; }
.admin-header input[type="text"] { flex:1; padding:8px 10px; border-radius:8px 0 0 8px; border:1px solid #ccc; border-right:none; min-width:0; }
.admin-header button { padding:8px 12px; border-radius:0 8px 8px 0; border:none; background:#003366; color:white; cursor:pointer; }

.admin-logout { padding:8px 12px; border-radius:8px; border:none; background:#c82333; color:white; cursor:pointer; }

.admin-table { width:100%; border-collapse:collapse; margin-top:6px; }
.admin-table th, .admin-table td { padding:8px 10px; border:1px solid #e0e0e0; text-align:left; vertical-align:top; font-size:14px; }
.admin-table th { background:#003366; color:white; }
.admin-table tr:nth-child(even) { background:#fafafa; }
.del-btn { background:#c82333; color:white; border:none; padding:6px 10px; border-radius:6px; cursor:pointer; }

/* ========== 반응형 네비 (핸드폰) ========== */
/* 반응형 */
/* 모바일 네비 - 최종 권장 */
/* 모바일 메뉴 (슬라이드 효과) */
@media (max-width: 768px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -220px;   /* 👉 처음에는 화면 밖 */
        height: 100vh;
        width: 220px;
        background: #003366;
        border-radius: 0; 
        padding: 60px 0 10px 0;
        box-shadow: -2px 0 10px rgba(0,0,0,0.3);
        transition: right 0.3s ease-in-out; /* 부드러운 이동 */
        z-index: 1000;
    }

    .nav-links.active {
        right: 0; /* 👉 화면 안으로 슬라이드 */
    }

    .menu-toggle {
        display: block;
        z-index: 1001; /* 메뉴 위에 버튼 유지 */
    }
}


/* ========== 모바일 최적화 ========== */
@media (max-width:600px) {
    main { padding:18px 12px; }
    #contact-form input, #contact-form textarea { font-size:14px; padding:10px; }
    .admin-header { flex-direction:column; align-items:stretch; }
    .admin-header form { width:100%; margin-bottom:8px; }
}
/* 관리자 헤더: 검색 + 로그아웃 수평 정렬 */
.admin-header {
    display: flex;
    justify-content: space-between; /* 좌우 끝으로 정렬 */
    align-items: center;
    margin-bottom: 20px;
}

/* 검색창 크기 & 버튼 */
.admin-header form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-header input[type="text"] {
    width: 220px;          /* 검색창 폭 적당히 조정 */
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.admin-header button {
    padding: 6px 12px;
    background-color: #003366;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.admin-header button:hover {
    background-color: #0055a5;
}

/* 로그아웃 버튼 스타일 */
.admin-logout {
    padding: 6px 12px;
    background-color: #c82333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.admin-logout:hover {
    background-color: #a71d2a;
}

/* 관리자 테이블 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.admin-table th {
    background-color: #f4f6f9;
}

/* 삭제 버튼 */
.del-btn {
    padding: 4px 10px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.del-btn:hover {
    background-color: #c0392b;
}

/* 로그인 폼 중앙 정렬 */
.admin-login-form {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 70vh; /* 화면 세로 가운데 */
}

.admin-login-form form {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    width: 300px;
}

.admin-login-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.admin-login-form button {
    width: 100%;
    padding: 10px;
    background-color: #003366;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.admin-login-form button:hover {
    background-color: #0055a5;
}

/* 오버레이 배경 */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* 반투명 어두운 배경 */
    z-index: 999; /* 메뉴보다 뒤에 */
}
.overlay.active {
    display: block;
}
/* ---------------- 모바일 카드형 테이블 ---------------- */
.admin-table-wrapper {
    width: 100%;
    overflow-x: auto; /* 가로 스크롤 허용 */
}

@media (max-width: 600px) {

    /* 테이블 전체 카드형 */
    .admin-table, 
    .admin-table thead, 
    .admin-table tbody, 
    .admin-table th, 
    .admin-table td, 
    .admin-table tr {
        display: block;
        width: 100%;
    }

    /* 헤더 숨김 */
    .admin-table thead { display: none; }

    /* 각 행 카드형 */
    .admin-table tr {
        background: #fff;
        border-radius: 10px;
        margin-bottom: 16px;
        padding: 12px 16px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }

    /* 각 셀 레이블 포함 */
    .admin-table td {
        display: flex;
        justify-content: space-between; /* 레이블 왼쪽, 내용 오른쪽 */
        padding: 6px 0;
        border: none;
        position: relative;
        word-break: break-word;
    }

    /* 레이블 */
    .admin-table td::before {
        content: attr(data-label);
        flex: 0 0 35%;   /* 레이블 고정폭 */
        font-weight: bold;
        color: #003366;
        padding-right: 8px;
        white-space: nowrap;
        text-align: left;
    }

    /* 내용 */
    .admin-table td span {
        flex: 1;         /* 내용 나머지 공간 차지 */
        text-align: left;
    }

    /* 삭제 버튼 */
    .del-btn {
        width: 100%;
        margin-top: 6px;
        box-sizing: border-box;
    }
}


/* 기존 PC 스타일 유지 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}

.admin-table th, .admin-table td {
    border: 1px solid #e0e0e0;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.admin-table th {
    background: #003366;
    color: white;
}

.admin-table tr:nth-child(even) { background: #fafafa; }

.del-btn {
    background: #c82333;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.del-btn:hover { background: #a71d2a; }
