/* 기본 리셋 */
html, body {
    margin: 0;
    padding: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}
body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f7fa;
    padding: 15px;
    display: flex;
    justify-content: center;
}
.container {
    max-width: 600px;
    width: 100%;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    height: auto;
    box-sizing: border-box;
}
h1 {
    text-align: center;
    color: #333;
    margin-top: 10px;
    font-size: 24px;
}

/* 검색창 박스 */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
}
.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}
.search-input-wrapper input {
    width: 100%;
    padding: 12px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

/* 회색 동그라미 X 버튼 */
.clear-btn {
    position: absolute;
    right: 12px;
    width: 22px;
    height: 22px;
    background-color: #ced4da;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 19px;
    font-size: 16px;
    cursor: pointer;
    display: none;
    user-select: none;
    z-index: 10;
}
.clear-btn:hover {
    background-color: #adb5bd;
}

button#searchBtn {
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
}
button#searchBtn:hover {
    background-color: #0056b3;
}

/* 가이드 박스 */
.search-notice-box {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}
.notice-item {
    font-size: 13.5px;
    color: #555;
    margin: 6px 0;
    padding-left: 12px;
    position: relative;
    font-weight: 500;
    line-height: 1.4;
}
.notice-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6c757d;
    font-weight: bold;
}

/* 팀 버튼 공간 */
.team-btn-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 2px;
    width: 100%;
    box-sizing: border-box;
}
.quick-team-btn {
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.quick-team-btn:hover {
    opacity: 0.85;
}
.quick-team-btn:active {
    transform: scale(0.95);
}

/* 결과 카드 구조 */
.result-list {
    max-height: none !important;
    overflow: visible !important;
    margin-top: 10px;
    width: 100%;
}
.card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 6px solid #007bff;
    box-sizing: border-box;
}
.card-header {
    display: flex;
    flex-direction: column; 
    gap: 10px;
    margin-bottom: 18px;
}
.card-header h3 {
    margin: 0;
    color: #222;
    font-size: 20px;
}
.badge-group {
    display: flex;
    gap: 8px;
}
.team-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}
.key-badge {
    background-color: #fff3cd;
    color: #856404;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

/* 액션 버튼 균형 배치 */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-link {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 120px;
    text-decoration: none;
    padding: 12px 8px;
    background: #28a745;
    color: white;
    border-radius: 6px;
    font-size: 14.5px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}
.btn-link.copy {
    background-color: #17a2b8;
    cursor: pointer;
    border: none;
}
.btn-link.copy:hover {
    background-color: #138496;
}
.btn-link.yt {
    background: #dc3545;
    cursor: pointer;
    border: none;
}
.btn-link.yt:hover {
    background: #cc0000;
}
.btn-link:hover {
    opacity: 0.9;
}

/* TOP 버튼 */
.go-to-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 48px;
    height: 48px;
    background-color: rgba(34, 34, 34, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 99999;
    display: none;
    transition: all 0.2s ease-in-out;
    padding: 0;
    line-height: 48px;
    text-align: center;
}
.go-to-top-btn:hover {
    background-color: #007bff;
    transform: scale(1.08);
}

/* 모달 팝업 공통 디자인 */
.modal {
    display: none; 
    position: fixed; 
    z-index: 100000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}
.modal-content {
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.close-modal {
    position: absolute;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}
.close-modal:hover {
    color: #ddd;
}

/* 유튜브 모달 전용 비율 박스 */
#youtubeModal .modal-content {
    background-color: #000;
    width: 90%;
    max-width: 560px;
    border-radius: 8px;
}
.close-modal#closeYoutube {
    top: -40px;
    right: 0;
    color: #fff;
}
.iframe-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}
.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}