@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #007bff;
    margin-bottom: 10px;
}

p {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

/* 자동완성을 위한 wrapper */
.autocomplete-wrapper {
    position: relative;
    width: 60%;
}

#nickname-input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #ced4da;
    font-size: 1em;
}

/* 자동완성 목록 컨테이너 */
.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
}

/* 자동완성 아이템 */
.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
    text-align: left;
}

.autocomplete-items div:hover {
    background-color: #e9e9e9;
}

#search-btn {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}

#search-btn:hover {
    background-color: #0056b3;
}

.loader {
    text-align: center;
    font-size: 1.2em;
    color: #6c757d;
    padding: 40px 0;
}

/* --- 종합 요약 카드 스타일 시작 --- */
#summary-container {
    margin-bottom: 30px;
}
.summary-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}
.summary-card h2 {
    margin-top: 0;
    color: #0056b3;
    text-align: center;
    margin-bottom: 20px;
}
.summary-items {
    display: flex;
    justify-content: space-around;
    text-align: center;
    flex-wrap: wrap;
    gap: 15px;
}
.summary-item {
    flex-basis: 200px;
}
.summary-item .label {
    font-size: 1em;
    color: #6c757d;
    margin-bottom: 5px;
}
.summary-item .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #343a40;
}
/* --- 종합 요약 카드 스타일 끝 --- */

.result-category {
    margin-bottom: 30px;
}

.result-category h2 {
    color: #0056b3;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.chart-container {
    width: 100%;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

th {
    background-color: #f2f2f2;
}

.back-button {
    display: block;
    width: fit-content;
    margin: 40px auto 0;
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #5a6268;
}


.search-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.function-buttons {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#saveAsImageBtn {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    background-color: #28a745;
    color: white;
}
#saveAsImageBtn:hover {
    background-color: #218838;
}

#capture-area {
    padding-top: 20px;
}

@media (max-width: 768px) {
    
    .search-container {
        flex-direction: column;
        align-items: center;
        margin-bottom: 15px;
    }
    #search-btn {
        width: 100%;
    }
    .function-buttons {
        margin: 15px 0;
    }
    #saveAsImageBtn {
        width: 100%;
    }
    
}


@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 1.8em;
    }
    .search-container {
        flex-direction: column;
        align-items: center;
    }
    .autocomplete-wrapper {
        width: 100%;
    }
    #search-btn {
        width: 100%;
    }
    th, td {
        padding: 8px;
        font-size: 0.9em;
    }
}