body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.search-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* 🚩 행정구역 검색 UI를 위한 스타일 추가 */
.search-container .input-group {
    display: flex;
    margin-bottom: 10px;
}

.search-container .input-group:last-child {
    margin-bottom: 0;
}

.search-container .input-group input,
.search-container .input-group select,
.search-container .input-group button {
    flex-grow: 1;
    margin-right: 5px;
}

.search-container .input-group button {
    flex-grow: 0;
    width: 80px;
}

#keyword-input, #course-select, #district-input {
    width: 250px;
    padding: 8px;
    border: 1px solid #ccc;
    resize: none;
    border-radius: 4px;
    font-size: 16px;
}

#search-button, #district-search-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

#search-button:hover, #district-search-button:hover {
    background-color: #0056b3;
}

/* 🚩 검색 버튼 클릭 시 활성화되는 스타일 */
#search-button.active {
    background-color: #003d7a;
    transform: scale(1.05); /* 약간 확대 */
}

#academy-detail {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    max-width: 90%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 20;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#academy-detail.visible {
    opacity: 1;
    visibility: visible;
}

#academy-detail .detail-header {
    font-size: 1.5em;
    font-weight: bold;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#academy-detail .detail-body .detail-row {
    display: flex;
    margin-bottom: 10px;
}

#academy-detail .detail-body .detail-row .detail-label {
    font-weight: bold;
    color: #555;
    min-width: 80px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
}

.close-button:hover {
    color: #333;
}

/* 팝업 모달 스타일 */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    text-align: left;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
}

.academy-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.academy-item:hover {
    background-color: #f5f5f5;
}

.academy-item:last-child {
    border-bottom: none;
}

.hidden {
    display: none !important;
}

/* AI 챗봇 스타일 */

#ai-button {
    position: fixed; /* 뷰포트에 고정 */
    bottom: 10px;
    right: 20px;
    z-index: 100; /* 다른 요소보다 항상 위에 표시 */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #6a11cb;
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

#top10-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: #007bff; /* 파란색 배경 */
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background-color 0.2s;
    z-index: 99;
}

#ai-popup {
    position: absolute;
    bottom: 90px;
    right: 20px;
    z-index: 20;
    width: 350px;
    height: 600px; /* Increased height */
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    display: flex; /* Revert to flexbox */
    flex-direction: column; /* Stack children vertically */
}

.popup-content {
    flex-grow: 1; /* Allow it to take available space */
    display: flex;
    flex-direction: column;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}



#top10-button:hover {
    transform: scale(1.05);
}
/* New header section for filter buttons */
#ai-popup-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

#keyword-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.keyword-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    color: #555;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
}

.keyword-btn.active {
    background-color: #6a11cb;
    color: white;
    border-color: #6a11cb;
}

#selected-keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.selected-keyword-tag {
    background-color: #6a11cb;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.popup-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #6a11cb;
}

.popup-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto; /* Now popup-body itself scrolls */
}

#ai-chat-display {
    flex-grow: 1;
    /* Removed max-height */
    overflow-y: auto;
    padding: 15px; /* Add padding here */
    display: flex;
    flex-direction: column;
}

.chat-message {
    padding: 10px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background-color: #e0f7fa;
    align-self: flex-end;
}

.ai-message {
    background-color: #f1f1f1;
    align-self: flex-start;
}

.ai-message.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { background-color: #f1f1f1; }
    50% { background-color: #e0e0e0; }
    100% { background-color: #f1f1f1; }
}

#ai-input-section {
    display: flex;
    align-items: center;
    border-top: 1px solid #eee;
    padding: 10px; /* Adjusted padding */
    background-color: white; /* Ensure it covers content below */
    z-index: 1; /* Ensure it's above chat content */
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 12px;
    margin-right: 8px;
    resize: none;
    max-height: 80px;
    overflow-y: auto;
    font-size: 16px;
}

#chat-send-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px; /* Changed to rectangular */
    width: 60px; /* Adjusted width */
    height: 30px; /* Adjusted height */
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-send-button:hover {
    background-color: #0056b3;
}

#recommend-button-container {
    margin-top: 10px;
    text-align: center;
}

#go-to-recommendation-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
}

#go-to-recommendation-button:hover {
    background-color: #218838;
}

/* 메시지 팝업 스타일 */
#message-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 20px;
    text-align: center;
}

.message-content {
    position: relative;
}

#message-text {
    margin: 0;
    color: #333;
}
/* public/style.css */

#dashboard-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#reviews-container {
    margin-top: 20px;
}

.review-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.review-item p {
    margin: 0 0 5px;
    font-size: 16px;
    line-height: 1.5;
}

.review-item span {
    font-size: 14px;
    color: #888;
    font-style: italic;
}

@media (max-width: 600px) {
    .search-container {
        position: fixed;
        flex-direction: column;
        top: 0;
        left: 0;
        right: 0;
        border-radius: 0;
        background-color: white;
        display: block; /* 🚩 flexbox를 block으로 변경하여 2줄 레이아웃으로 변경 */
    }

    .search-container .input-group {
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem; /* 🚩 간격 조정 */
    }

    /* 🚩 첫 번째 줄 요소 비율 조정 */
    .search-container .input-group:nth-child(1) #keyword-input {
        width: 40%;
    }

    .search-container .input-group:nth-child(1) #course-select {
        width: 30%;
    }

    .search-container .input-group:nth-child(1) #search-button {
        width: 30%;
        margin-left: 0.5rem; /* 간격 조정 */
    }

    /* 🚩 두 번째 줄 요소 비율 조정 */
    .search-container .input-group:nth-child(2) #district-input {
        width: 70%;
    }

    .search-container .input-group:nth-child(2) #district-search-button {
        width: 30%;
        margin-left: 0.5rem; /* 간격 조정 */
    }
   
       /* 모바일용 #ai-popup 위치 조정 */
       #ai-popup {
        bottom: 110px;
        right: 15px;
        width: 90%;
        height: 70vh;
      }
   
      #ai-button {
          bottom: 10px;
          right: 10px;
      }

      #top10-button {
          bottom: 70 px;
          right: 10px;
      }

    }
   