/* --- 기본 & 변수 설정 --- */
:root {
    --main-navy: #001f3f;
    --light-sky-blue: #A9D0F5;
    --accent-blue: #3498db;
    --saegil-blue: #3986c6;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-gray: #e9ecef;
    --white: #ffffff;
    --danger: #e74c3c;
    --success: #2ecc71;
    --font-family: 'Pretendard', sans-serif;
    --border-radius: 12px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-family); background-color: var(--background-color); color: var(--text-color); line-height: 1.6; }
.wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.content { flex: 1; }
.container { max-width: 1000px; margin: 2rem auto; padding: 2rem; background-color: var(--white); border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
h1, h2, h3 { color: var(--main-navy); margin-bottom: 1rem; }
p { margin-bottom: 1rem; }
a { color: var(--accent-blue); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--saegil-blue); }
.divider { border-top: 1px solid var(--light-gray); margin: 2.5rem 0; }

/* --- 헤더 & 푸터 (공통) --- */
.header, .footer { padding: 1rem 2rem; background-color: var(--main-navy); color: var(--white); }
.header-content, .footer-content { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-size: 1.5rem; font-weight: 600; color: var(--white); text-decoration: none; }
.logo img { height: 32px; width: auto; object-fit: contain; }
.main-nav ul { list-style: none; display: flex; gap: 1.5rem; }
.main-nav a { color: var(--white); font-weight: 600; padding: 0.5rem 0; position: relative; }
.main-nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--light-sky-blue); transition: width 0.3s ease; }
.main-nav a:hover::after { width: 100%; }
.footer { text-align: center; font-size: 0.9rem; background-color: #343a40; }
.footer-links { align-self: flex-end; }
.secret-admin-link,
.secret-admin-link:hover { color: inherit; text-decoration: none; /*cursor: default;*/ /* 마우스를 올려도 손가락 모양으로 바뀌지 않음 */ }

/* --- 대여 페이지 (사용자) --- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1.5rem; }
.item-card { background-color: var(--background-color); border: 2px solid var(--light-gray); border-radius: var(--border-radius); padding: 0.5rem; text-align: center; cursor: pointer; transition: all 0.3s ease; }
.item-card:hover { transform: translateY(-5px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); }
.item-card.selected { border-color: var(--accent-blue); background-color: #eaf5fc; }
.item-name { font-weight: 600; font-size: 1.1rem; margin-bottom: 0rem; }
.item-stock { font-size: 0.9rem; color: #555; }
.item-stock.checking { color: #999; font-style: italic; }

/* --- [추가] 재고 없음 스타일 --- */
.item-card.out-of-stock { background-color: #f1f3f5; border-color: #dee2e6; cursor: not-allowed; pointer-events: none; /* 클릭 이벤트를 완전히 막습니다. */ }
.item-card.out-of-stock:hover { transform: none; box-shadow: none; } /* 재고 없는 카드는 호버 효과 제거 */
.item-card.out-of-stock .item-name { color: #adb5bd; } /* 재고 없는 카드의 이름도 회색으로 처리 */
.item-stock.out-of-stock { color: var(--danger); /* 위험/경고 색상으로 강조 */ font-weight: 600; } /* "재고 없음" 텍스트 스타일 */

/* --- 장바구니 관련인듯? --- */
.cart-items-container { background-color: #f8f9fa; border-radius: var(--border-radius); padding: 1rem 1.5rem; min-height: 80px; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cart-placeholder { color: #888; margin: 0; }
.cart-item-tag { background-color: var(--light-sky-blue); color: var(--main-navy); padding: 0.5rem 1rem; border-radius: 20px; font-weight: 600; }
.cart-section{ margin-bottom: 1rem; }

/* --- 폼 요소 (공통) --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
input, select { width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--light-gray); border-radius: 8px; font-size: 1rem; }
input:focus, select:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2); }
.submit-btn { width: 100%; padding: 1rem; margin-top: 2rem; border: none; border-radius: 8px; background-color: var(--accent-blue); color: var(--white); font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: background-color 0.3s; }
.submit-btn:hover { background-color: #2980b9; }
.submit-btn:disabled { background-color: #bdc3c7; cursor: not-allowed; }
.btn-primary { display: inline-block; margin-top: 2rem; padding: 0.8rem 2rem; background-color: var(--main-navy); color: white; border-radius: 8px; }

/* --- 신청/대여 확인 페이지 --- */
.check-form-container { background-color: #f8f9fa; padding: 2rem; border-radius: var(--border-radius); text-align: center; }
.check-form { max-width: 500px; margin: 1.5rem auto 0; }
.check-form .submit-btn { margin-top: 1rem; }

.user-info-display { margin-top: 3rem; }
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}
.info-grid span { font-size: 1.1rem; }
.no-records-message { text-align: center; margin-top: 3rem; font-size: 1.2rem; color: #555; }
/* --- 테이블 --- */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; /* 모바일에서 부드러운 스크롤을 위함 */ }
table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
th, td { padding: 0.5rem; text-align: left; border-bottom: 1px solid var(--light-gray); white-space: nowrap; /* 셀 안의 내용(텍스트)이 줄바꿈되지 않도록 하여 테이블이 줄어드는 것을 방지 */ }
th { background-color: #f8f9fa; font-weight: 600; }

/* --- 조직도 페이지 --- */
.org-chart-container { text-align: center; /* 내부 요소들을 가운데 정렬 */ }
.chart-image-wrapper { padding: 1rem; background-color: var(--white); border-radius: var(--border-radius); box-shadow: var(--box-shadow); display: inline-block; /* 이미지 크기에 맞게 컨테이너 크기 조절 */ }
.chart-image-wrapper img { max-width: 100%; /* 이미지가 부모 요소를 넘어가지 않도록 함 */ height: auto; display: block; /* 이미지 아래 불필요한 여백 제거 */ }

/* --- 기타 페이지 (성공, 로그인) --- */
.success-container { text-align: center; }
.success-box { padding: 3rem; }
.success-icon { font-size: 4rem; margin-bottom: 1rem; }
.borrowed-list { margin-bottom: 2rem; text-align: left; display: inline-block; }
.borrowed-list ul { list-style: none; margin-top: 0.5rem; }
.return-info { font-size: 1.2rem; font-weight: 600; color: var(--danger); background-color: #fdf2f2; padding: 1rem; border-radius: var(--border-radius); word-break: keep-all;}
.login-container { max-width: 450px; text-align: center; }

/* --- 공통 컴포넌트 (플래시 메시지, 반응형) --- */
.flash-message { padding: 1rem; margin-bottom: 1rem; border-radius: 8px; font-weight: 600; }
.flash-message.error { background-color: #fdeded; color: #c0392b; }
.flash-message.success { background-color: #e8f8f5; color: #16a085; }
.hamburger-btn { display: none; font-size: 1.5rem; background: none; border: none; color: white; cursor: pointer; }

.floating-sns { position: fixed; right: 5px; bottom: 5px; width: 110px; background: white; border-radius: 16px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); padding: 12px 10px; z-index: 9999; border: 1px solid gray; }
.floating-sns .sns-header { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 5px; } /* 로고와 타이틀을 나란히 정렬 */
.floating-sns .fond-logo { width: 30px; height: auto; margin: 0; } /* 로고 이미지 */
.floating-sns .fond-title { font-size: 12px; font-weight: bold; color: #222; line-height: 1.2; text-align: left; } /* 새길 #SNS 텍스트 */
.floating-sns .fond-title strong { color: #e0245e; /* hashtag red */ }
.floating-sns .sns-links { display: flex; flex-direction: column; gap: 2px; } /* SNS 링크들 */
.floating-sns .sns-item { display: flex;  align-items: center; gap: 8px; text-decoration: none; color: #000; font-size: 13px; }
.floating-sns .sns-item img { width: 30px; height: 30px; }

@media (max-width: 768px) {
    .header-content { position: relative; }
    .main-nav { display: none; position: absolute; top: 100%; right: 0; background-color: var(--main-navy); width: 250px; flex-direction: column; padding: 1rem; box-shadow: -5px 5px 15px rgba(0,0,0,0.2); z-index: 100; }
    .main-nav.active { display: flex; max-width: 180px; padding: 0.6rem;}
    .main-nav ul { flex-direction: column; width: 100%; gap: 0.5rem;}
    .main-nav li { width: 100%; }
    .main-nav a { display: block; padding: 0.5rem; }
    .hamburger-btn { display: block; }
    .form-grid { grid-template-columns: 1fr; }
    .container { padding: 1rem; margin: 1rem; }
    .footer-content { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    /*물품 스타일*/
    .item-name { font-size: 1rem; }
    .item-stock { font-size: 0.8rem; }
}