/* Styles for main_page.jsp */


.main-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    padding-bottom: 100px; /* Add padding to prevent content from being hidden by fixed footer/aside */
}

.main-content-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 0;
}

/* Obesity Calculator - Fixed Bottom Right - UPDATED STYLES */
.obesity-calculator-aside {
    position: fixed;
    bottom: 40px; /* Moved up a bit (was 20px) */
    right: 20px;
    width: 270px; /* Made smaller (was 300px) */
    padding: 15px; /* Reduced padding (was 20px) */
    background-color: rgba(249, 249, 249, 0.95); /* Light background with opacity */
    /* Or, if you prefer the opacity to affect the whole element including text:
    background-color: #f9f9f9;
    opacity: 0.95;
    */
    border: 1px solid var(--line3, #eaeced); /* Lighter border */
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1); /* Softer shadow */
    z-index: 1000;
    height: auto;
}

.obesity-calculator-aside h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.05em; /* Slightly smaller title */
    color: var(--gray1, #222);
    text-align: center;
}

.obesity-calculator-aside .form-group {
    margin-bottom: 10px; /* Slightly reduced margin */
}

.obesity-calculator-aside label {
    display: block;
    margin-bottom: 4px; /* Slightly reduced margin */
    font-size: 0.85em; /* Smaller label text */
    color: var(--gray2, #555);
}
.obesity-calculator-aside label.radio-label {
    display: inline-block;
    margin-left: 3px;
    margin-right: 8px; /* Reduced spacing */
    font-weight: normal;
    font-size: 0.85em; /* Consistent smaller text */
}

.obesity-calculator-aside input[type="number"],
.obesity-calculator-aside input[type="text"] {
    width: calc(100% - 14px); /* Adjusted for padding */
    padding: 7px; /* Reduced padding */
    border: 1px solid var(--gray6, #d6d6d6);
    border-radius: 4px;
    font-size: 0.85em; /* Smaller input text */
    box-sizing: border-box;
}

.obesity-calculator-aside input[type="radio"] {
    margin-right: 2px;
    vertical-align: middle;
}
.obesity-calculator-aside label.radio-label {
    vertical-align: middle;
}

/* UPDATED Button Style for "진단하기" and "결과보기" */
.obesity-calculator-aside .aside-button {
    background-color: var(--gray5, #b7b7b7); /* Grayish background - less prominent */
    color: var(--gray1, #222222); /* Darker text for better contrast on light gray */
    border: 1px solid var(--gray6, #d6d6d6); /* Subtle border */
    padding: 8px 12px; /* Reduced padding */
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 0.9em; /* Smaller button text */
    margin-top: 8px; /* Reduced margin */
    font-family: 'ns-r', sans-serif; /* Regular weight font */
}

.obesity-calculator-aside .aside-button:hover {
    background-color: var(--gray4, #8f8f8f); /* Slightly darker gray on hover */
    color: var(--gray8, #ffffff);
}

/* If you want the primary action button (e.g., if "결과보기" becomes primary after diagnosis) to be different:
.obesity-calculator-aside .aside-button.primary-action {
    background-color: var(--main1, #CE2029);
    color: white;
    border-color: var(--main1, #CE2029);
}
.obesity-calculator-aside .aside-button.primary-action:hover {
    background-color: var(--main2, #E04141);
    border-color: var(--main2, #E04141);
}
*/

#obesityResult {
    margin-top: 15px; /* 위쪽 여백을 줘서 다른 요소들과 분리 */
    padding: 10px; /* 내부 패딩을 줘서 내용이 너무 붙지 않도록 */
    border-top: 1px dashed var(--line4, #f0f0f0); /* 구분선을 추가 (선택 사항) */
    color: var(--gray1, #222); /* 텍스트 색상을 명확하게 지정 */
    font-size: 0.9em; /* 텍스트 크기 조정 */
    line-height: 1.5; /* 줄 간격 조정 */
    
    /* 결과가 길어질 경우 스크롤이 생기도록 할 수도 있습니다.*/
    max-height: 100px;
    overflow-y: auto;
    
}

#obesityResult p {
    margin: 5px 0; /* 내부 p 태그들의 상하 마진 조정 */
    padding: 0; /* 내부 p 태그들의 패딩 제거 */
    color: var(--gray1, #222); /* 텍스트 색상을 명확하게 지정 */
}

/* Search Section - No changes */
.search-section {
    padding: 25px;
    background-color: var(--box-bg, #f0f1f1);
    border-radius: 8px;
    text-align: center;
}
.search-intro-text {
    font-size: 1.3em;
    font-family: 'ns-b', sans-serif;
    color: var(--gray1, #333);
    margin-bottom: 20px;
}
.search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.search-input-group {
    display: flex;
    width: 100%;
    max-width: 600px;
}
.search-input-group .location-input {
    flex-grow: 1;
    padding: 12px 15px;
    font-size: 1em;
    border: 1px solid var(--gray6, #ccc);
    border-radius: 5px 0 0 5px;
    border-right: none;
}
.search-input-group .search-button {
    padding: 12px 25px;
    font-size: 1em;
    background-color: var(--main1, #CE2029);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-family: 'ns-b', sans-serif;
}
.search-input-group .search-button:hover {
    background-color: var(--main2, #E04141);
}
.search-filters select {
    padding: 10px;
    font-size: 0.9em;
    border: 1px solid var(--gray6, #ccc);
    border-radius: 5px;
    min-width: 150px;
    background-color: white;
}

/* Gym Listings Overview (Hot posts & New gyms) - HORIZONTAL LAYOUT - No changes */
.gym-listings-overview {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.gym-listings-overview::-webkit-scrollbar { display: none; }

.hot-posts-section,
.new-gyms-section {
    flex: 1 1 48%;
    min-width: 300px;
    background-color: #fff;
    padding: 20px;
    border: 1px solid var(--line3, #eaeced);
    border-radius: 8px;
    box-sizing: border-box;
}

.hot-posts-section h3,
.new-gyms-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-family: 'ns-b', sans-serif;
    font-size: 1.2em;
    color: var(--gray1, #222);
    border-bottom: 2px solid var(--main3, #F5B8B8);
    padding-bottom: 8px;
}

.hot-posts-section ul,
.new-gyms-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-posts-section ul li,
.new-gyms-section ul li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--line4, #f6f6f6);
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hot-posts-section ul li:last-child,
.new-gyms-section ul li:last-child {
    border-bottom: none;
}

.hot-posts-section ul li a,
.new-gyms-section ul li a {
    text-decoration: none;
    color: var(--gray2, #555);
    transition: color 0.2s;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-posts-section ul li a:hover,
.new-gyms-section ul li a:hover {
    color: var(--main1, #CE2029);
}

/* Nearby Gyms Section - Carousel - No changes to this section's CSS */
.nearby-gyms-section { margin-top: 20px; position: relative; }
.nearby-gyms-section h2 {
    font-family: 'ns-b', sans-serif; font-size: 1.5em; color: var(--gray1, #222);
    margin-bottom: 20px; text-align: left;
}
.gym-carousel-wrapper { display: flex; align-items: center; position: relative; }
.carousel-arrow {
    background-color: rgba(255, 255, 255, 0.8); border: 1px solid var(--gray6, #ccc);
    border-radius: 50%; width: 40px; height: 40px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: background-color 0.2s, opacity 0.2s;
}
.carousel-arrow:hover { background-color: rgba(240, 240, 240, 0.9); }
.carousel-arrow:disabled { opacity: 0.5; cursor: default; }
.carousel-arrow .material-icons { font-size: 28px; color: var(--gray2, #555); }
.prev-arrow { margin-right: 10px; }
.next-arrow { margin-left: 10px; }

.gym-cards-outer-container {
    flex-grow: 1; overflow-x: auto;
    -ms-overflow-style: none; scrollbar-width: none;
}
.gym-cards-outer-container::-webkit-scrollbar { display: none; }

.gym-cards-inner-container {
    display: flex; flex-direction: row; padding-bottom: 10px; width: max-content;
}
.gym-card {
    border: 1px solid var(--line3, #eaeced); border-radius: 8px; overflow: hidden;
    background-color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease; width: 230px; flex-shrink: 0;
    margin-right: 15px; box-sizing: border-box;
}
.gym-card:last-child { margin-right: 0; }
.gym-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.gym-card-image { width: 100%; height: 160px; background-color: #f0f0f0; }
.gym-card-image img { width: 100%; height: 100%; object-fit: cover; }
.gym-card-info { padding: 15px; }
.gym-card-info h4 {
    margin-top: 0; margin-bottom: 8px; font-size: 1.1em;
    font-family: 'ns-b', sans-serif; color: var(--gray1, #333);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gym-card-info p {
    margin: 0; font-size: 0.9em; color: var(--gray3, #717171);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hot-posts-section,
    .new-gyms-section {
        min-width: 250px;
    }
    .gym-card { width: 200px; }
    .search-input-group { flex-direction: column; gap: 10px; }
    .search-input-group .location-input,
    .search-input-group .search-button { border-radius: 5px; width: 100%; }
    .search-input-group .location-input { border-right: 1px solid var(--gray6, #ccc); }

    .obesity-calculator-aside { /* Adjust fixed aside for smaller screens */
        width: 250px; /* Further reduced for tablets */
        padding: 12px;
        bottom: 15px;
        right: 15px;
    }
    .obesity-calculator-aside h4 { font-size: 1em; }
}

@media (max-width: 480px) {
    .hot-posts-section,
    .new-gyms-section {
        min-width: 220px;
    }
    .gym-card { width: 180px; }
    .prev-arrow { margin-right: 5px; }
    .next-arrow { margin-left: 5px; }
    .carousel-arrow { width: 30px; height: 30px; }
    .carousel-arrow .material-icons { font-size: 20px; }

    .obesity-calculator-aside {
        width: calc(100% - 20px); /* Take most of width */
        max-width: 260px; /* But not too wide */
        bottom: 10px;
        right: 10px;
        left: 10px; /* Allow it to center if you use margin: auto for left/right */
        margin-left: auto;
        margin-right: auto;
        /* If you strictly want it bottom-right even on smallest screens:
        left: auto;
        right: 10px;
        */
        padding: 10px;
    }
    .obesity-calculator-aside .aside-button {
        padding: 8px 10px;
        font-size: 0.85em;
        background-color: #F5B8B8;
    }
}

.search-section {
    background-image: url("../upload/index/index_img.jpg"); /* 밝은 헬스장 이미지 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 60px 20px;
    border-radius: 12px;
    position: relative;
    color: #333; /* 어두운 글씨로 변경 */

    /* 밝은 배경에 어울리는 box shadow */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 밝은 배경 위에 텍스트 가독성을 확보하고 싶을 경우 약간 흐린 오버레이 추가 */
.search-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6); /* 밝은 흰색 오버레이 */
    border-radius: 12px;
    z-index: 0;
}

.search-section * {
    position: relative;
    z-index: 1; /* 텍스트 요소가 오버레이 위에 나오도록 */
}

/* 2026 main page refinement */
.main-page-container {
    width: min(1200px, calc(100% - 40px));
    margin: 38px auto 0;
    gap: 26px;
}
.main-content-area { min-width: 0; }
.search-section {
    min-height: 330px;
    display: grid;
    align-content: center;
    padding: 56px clamp(22px, 6vw, 74px);
    border: 1px solid rgba(86, 21, 34, .08);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(38, 24, 27, .12);
}
.search-section::before { background: linear-gradient(120deg, rgba(255,250,248,.94), rgba(255,255,255,.74) 58%, rgba(247,232,226,.78)); border-radius: 24px; }
.search-intro-text { max-width: 650px; width: 100%; justify-self: center; align-self: center; color: var(--brand-900); font-size: clamp(24px, 3.2vw, 40px); line-height: 1.25; letter-spacing: -.05em; text-align: center; }
.search-form { max-width: 690px; width: 100%; margin-left: auto; margin-right: auto; align-items: center; }
.search-input-group { width: 100%; margin-left: auto; margin-right: auto; padding: 6px; border: 1px solid rgba(86,21,34,.12); border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(38,24,27,.1); }
.search-input-group .location-input { min-height: 50px; border: 0 !important; box-shadow: none !important; }
.search-input-group .search-button { min-width: 112px; border-radius: 10px !important; background: var(--brand-700); }
.search-filters { display: flex; gap: 9px; margin-top: 12px; }
.search-filters select { min-height: 42px; border-color: rgba(86,21,34,.14); border-radius: 9px; background: rgba(255,255,255,.92); }
.gym-listings-overview { gap: 18px; padding: 28px 0 8px; }
.hot-posts-section, .new-gyms-section {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.hot-posts-section h3, .new-gyms-section h3 { color: var(--brand-900); }
.nearby-gyms-section { margin-top: 38px; }
.nearby-gyms-section h2 { font-size: 25px; color: var(--ink); }
.gym-card { width: 250px; border-radius: 16px; overflow: hidden; }
.gym-card-image { height: 176px; }
.carousel-arrow { border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.obesity-calculator-aside {
    position: sticky;
    top: 98px;
    bottom: auto;
    right: auto;
    width: 286px;
    border: 1px solid rgba(86,21,34,.08);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow);
}
.obesity-calculator-aside h4 { color: var(--brand-900); }
.obesity-calculator-aside .aside-button { border-radius: 10px; background: var(--brand-700); }

@media (max-width: 980px) {
    .main-page-container { width: calc(100% - 24px); display: block; }
    .obesity-calculator-aside { position: static; width: 100%; margin: 26px 0 0; }
}
@media (max-width: 640px) {
    .main-page-container { width: calc(100% - 20px); margin-top: 20px; }
    .search-section { min-height: 300px; padding: 32px 18px; }
    .search-input-group { flex-direction: column; }
    .search-input-group .search-button { width: 100%; }
    .search-filters { flex-direction: column; }
    .gym-listings-overview { flex-direction: column; overflow: visible; }
    .hot-posts-section, .new-gyms-section { min-width: 0; width: 100%; }
}

/* Floating BMI panel: follows vertical scrolling with a safe edge gap. */
@media (min-width: 1281px) {
    .obesity-calculator-aside {
        position: sticky;
        z-index: 20;
        top: 104px;
        right: auto;
        align-self: start;
        margin: 0;
        max-height: calc(100vh - 128px);
        overflow-y: auto;
    }
    .header .header-container { width:min(1440px,calc(100% - 48px)); }
    .main-page-container {
        display:grid;
        grid-template-columns:1fr;
        align-items:start;
        width:min(1440px,calc(100% - 48px));
        gap:30px;
        padding:0;
        background:transparent;
    }
    .main-content-area {
        padding:30px;
        border:1px solid rgba(86,21,34,.07);
        border-radius:24px;
        background:#fff;
        box-shadow:var(--shadow-sm);
    }
}

@media (min-width:981px) and (max-width:1280px) {
    .main-page-container { display:grid;grid-template-columns:1fr;gap:22px;width:calc(100% - 32px); }
    .main-content-area { padding:24px;border-radius:22px;background:#fff;box-shadow:var(--shadow-sm); }
    .obesity-calculator-aside { width:280px;margin:0;align-self:start;top:92px; }
}

@media (max-width:980px) {
.main-content-area { padding:18px;border-radius:20px;background:#fff;box-shadow:var(--shadow-sm); }
}

/* Keep the nearby-gym cards visually anchored inside their section. */
.nearby-gyms-section {
    padding: 26px 24px 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.nearby-gyms-section h2 { margin: 0 0 18px; }
.nearby-gyms-section .gym-carousel-wrapper { gap: 12px; }
.nearby-gyms-section .gym-cards-outer-container { min-width: 0; padding: 6px 2px 12px; }
.nearby-gyms-section .gym-cards-inner-container { align-items: stretch; gap: 16px; padding: 0 4px 8px; }
.nearby-gyms-section .gym-card {
    margin: 0;
    border: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(30, 25, 28, .08);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.nearby-gyms-section .gym-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-300);
    box-shadow: var(--shadow);
}
.nearby-gyms-section .gym-card-info { min-height: 108px; padding: 18px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; background: #fff; text-align: center; }
.nearby-gyms-section .gym-card-info h4 { width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nearby-gyms-section .gym-card-info p { width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-content-area { background: linear-gradient(180deg, #fffdfc 0%, #f8f3f0 100%); }
.gym-listings-overview .hot-posts-section,
.gym-listings-overview .new-gyms-section { background: linear-gradient(145deg, #fff 0%, #fff8f5 100%); }

/* Spacious landing-page treatment for the home screen. */
@media (min-width: 981px) {
    .main-page-container { width: min(1480px, calc(100% - 56px)); margin-top: 30px; }
    .main-content-area { padding: 0 0 56px; background: transparent; }
    .search-section {
        min-height: 390px;
        padding: 70px clamp(34px, 8vw, 120px);
        border: 0;
        border-radius: 28px;
        background: linear-gradient(120deg, #24153f 0%, #632746 48%, #e88970 100%);
        box-shadow: 0 24px 55px rgba(43, 27, 66, .24);
    }
    .search-section::before { background: linear-gradient(120deg, rgba(23,15,45,.14), rgba(255,255,255,.12)); }
    .search-intro-text { max-width: 900px; color: #fff; font-size: clamp(24px, 2.8vw, 36px); white-space: nowrap; text-shadow: 0 3px 20px rgba(20,10,30,.25); }
    .search-form { max-width: 780px; margin-top: 24px; }
    .search-input-group { padding: 8px; border: 0; border-radius: 17px; box-shadow: 0 16px 35px rgba(27, 15, 46, .22); }
    .search-input-group .location-input { min-height: 58px; padding-left: 20px; font-size: 16px; }
    .search-input-group .search-button { min-width: 136px; min-height: 58px; border-radius: 12px !important; background: var(--brand-700); }
    .gym-listings-overview { gap: 24px; padding: 34px 0 12px; }
    .hot-posts-section, .new-gyms-section { padding: 26px 28px; border-radius: 20px; }
    .nearby-gyms-section { margin-top: 28px; padding: 32px; border-radius: 24px; }
}

/* Keep the page canvas white while retaining contrast inside featured blocks. */
body:has(.main-page-container) { background: #fff !important; }
.main-page-container { background: #fff; }
.nearby-gyms-section h2 { font-size: 21px; font-weight: 700; }
@media (min-width: 981px) {
    .search-section { padding-left: 24px; padding-right: 24px; }
    .search-form, .search-input-group { max-width: 820px; width: 100%; }
    .search-input-group .location-input { flex: 1 1 auto; }
}
