/* 전체 페이지 기본 설정 */
body {
    font-family: 'Arial', sans-serif;
    background-color: #222;
    color: #eee;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    background-color: #333;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    max-width: 900px; /* 전체 컨테이너 최대 너비 */
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

/* 프로필 헤더 */
/* 프로필 헤더 */
.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.btn-logout:hover {
    background: #c82333;
}

.btn-login {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.btn-login:hover {
    background: #0056b3;
}

.btn-profile {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    margin-right: 10px;
}

.btn-profile:hover {
    background: #1e7e34;
}


.profile-picture {
    width: 150px;   /* 크기를 150px로 키움 */
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 30px;
    /* border 속성 제거 */
}

.header-text-content {
    flex-grow: 1;
    text-align: center; /* <-- 모든 텍스트를 가운데 정렬 */
}

.header-text-content h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    color: #f1c40f;
    font-weight: 300;
}

.header-text-content hr {
    border: 0;
    height: 1px;
    background-color: #555;
    margin: 10px auto; /* 가운데 정렬을 위해 auto 추가 */
    width: 80%; /* 선 길이 조절 */
}

.intro-text {
    color: #bbb;
    font-size: 1.1em;
    margin: 10px 0 0 0;
}
.section-divider {
    border: 0;
    height: 1px;
    background-color: #555;
    margin: 30px 0;
}

/* 노래 테이블 스타일 */
.song-table {
    width: 100%;
    border-collapse: collapse; /* 셀 경계선 병합 */
    margin-top: 20px;
}

.song-table th, .song-table td {
    border: 1px solid #444;
    padding: 12px;
    text-align: left;
}

.song-table th {
    background-color: #444;
    color: #3498db;
    text-align: center;
}

/* 정렬 가능한 헤더에만 마우스 포인터와 호버 효과 적용 */
.song-table th[data-sort] {
    cursor: pointer;
    transition: background-color 0.2s;
}

.song-table th[data-sort]:hover {
    background-color: #5a5a5a;
}

.song-table th.active { /* 정렬된 컬럼 표시 */
    background-color: #2ecc71;
    color: white;
}

.song-table tbody tr {
    transition: background-color 0.2s;
}

.song-table tbody tr:nth-child(even) { /* 짝수 행 배경색 */
    background-color: #3a3a3a;
}

.song-table tbody tr:hover {
    background-color: #4c4c4c; /* 마우스 오버 시 */
}

.song-table tbody tr.playing { /* 재생 중인 노래 행 */
    background-color: #2ecc71;
    color: white;
}

/* 테이블 내 버튼 */
.song-table .btn {
    background: #f1c40f; /* 검색 버튼과 동일한 노란색 */
    color: #333; /* 어두운 텍스트 */
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 0.9em;
}
.song-table .btn:hover {
    background: #f39c12; /* 검색 버튼 hover와 동일 */
    transform: translateY(-1px);
}

/* 오디오 플레이어 */
#music-player {
    width: 80%;
    max-width: 600px;
    margin-top: 20px;
    background-color: #333;
    border-radius: 5px;
}

/* 관리자 페이지 링크 */
a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #2ecc71;
}

/* 모달 (팝업) 스타일 */
.modal-overlay {
    display: none; /* 기본적으로 숨김 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.visible {
    display: flex; /* 보일 때 */
}

.modal-content {
    background-color: #333;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    position: relative;
    color: #eee;
}

.modal-content h3 {
    margin-top: 0;
    color: #3498db;
}

.modal-content pre {
    white-space: pre-wrap; /* 가사 줄바꿈 유지 */
    max-height: 400px;
    overflow-y: auto;
    background-color: #222;
    padding: 15px;
    border-radius: 5px;
    color: #bbb;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8em;
    color: #aaa;
    cursor: pointer;
}

.close-btn:hover {
    color: #fff;
}

/* 테이블 정렬 스타일 추가 */

/* 1. 테이블 헤더(제목)는 모두 가운데 정렬 */
.song-table th {
    text-align: center;
}

/* 2. 테이블 내용(레코드)은 기본적으로 가운데 정렬 */
.song-table td {
    text-align: center;
}

/* 3. 단, 내용 중에서 첫 번째 칸(노래 제목)만 왼쪽 정렬 */
.song-table td:first-child {
    text-align: left;
}

/* 테이블 정렬 방향 표시 */
.song-table th[data-direction="asc"]::after {
    content: " ▲";
}

.song-table th[data-direction="desc"]::after {
    content: " ▼";
}
/* 검색창 스타일 */
.search-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 780px; /* 상단 4개 메뉴 버튼의 정확한 전체 너비 (180px×4 + 20px×3) */
    max-width: 100%;
}

#search-input {
    flex: 1;
    padding: 12px 15px;
    background-color: #2c2c2c;
    border: 1px solid #555;
    border-radius: 8px;
    color: white;
    font-size: 1em;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out; /* 부드러운 전환 효과 */
}

#search-button {
    padding: 12px 20px;
    background: #f1c40f;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#search-button:hover {
    background: #f39c12;
    transform: translateY(-1px);
}

/* 검색창을 클릭했을 때(focus) 효과 */
#search-input:focus {
    border-color: #f1c40f; /* 테두리 색상 변경 */
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.3); /* 은은한 그림자 효과 */
    outline: none; /* 기본 아웃라인 제거 */
}
/* 프로필 헤더의 플레이리스트 버튼 스타일 */

.btn-playlist {
    position: relative;
    top: 70px; /* 맞추셨던 위치 */
    margin-left: auto;
    align-self: center;
    padding: 10px 20px;
    background-color: #FFD1DC;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-playlist:hover {
    background-color: #FFB6C1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
/* ===== App Layout ===== */
.app-layout {
    display: flex;
    gap: 20px;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.main-content {
    flex-grow: 1;
}

/* ===== Playlist Sidebar ===== */
.playlist-container {
    background-color: #3e3e3e;
    padding: 20px;
    border-radius: 10px;
}

.sidebar-title {
    color: #f1c40f;
    margin-top: 0;
    text-align: center;
}

.playlist-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.playlist-list li a {
    display: block;
    padding: 12px;
    border-radius: 5px;
    color: #eee;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #555;
}

.playlist-list li:last-child a {
    border-bottom: none;
}

.playlist-list li a:hover,
.playlist-list li a.active {
    background-color: #555;
    color: #f1c40f;
}

.playlist-new {
    display: flex;
}

.playlist-new input {
    flex-grow: 1;
    border: 1px solid #555;
    background-color: #2c2c2c;
    color: white;
    padding: 10px;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.playlist-new button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 0 18px;
    font-size: 1.5em;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
}
/* ===== App Layout ===== */
.app-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.main-content {
    flex-grow: 1;
}

/* ===== Playlist Sidebar ===== */
.playlist-container {
    background-color: #3e3e3e;
    padding: 20px;
    border-radius: 10px;
}

/* (이하 playlist.css에 있던 스타일과 동일) */
.sidebar-title {
    color: #f1c40f;
    margin-top: 0;
    text-align: center;
}

.playlist-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.playlist-list li a {
    display: block;
    padding: 12px;
    border-radius: 5px;
    color: #eee;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #555;
}

.playlist-list li:last-child a {
    border-bottom: none;
}

.playlist-list li a:hover,
.playlist-list li a.active {
    background-color: #555;
    color: #f1c40f;
}

.playlist-new {
    display: flex;
}

.playlist-new input {
    flex-grow: 1;
    border: 1px solid #555;
    background-color: #2c2c2c;
    color: white;
    padding: 10px;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.playlist-new button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 0 18px;
    font-size: 1.5em;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
}
/* 플레이리스트 선택 모달 리스트 스타일 */
.modal-playlist-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.modal-playlist-list li {
    padding: 12px;
    border-radius: 5px;
    background-color: #444;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-playlist-list li:hover {
    background-color: #555;
    color: #f1c40f;
}

/* 이미 추가된 플레이리스트 스타일 */
.modal-playlist-list li.already-added-item {
    background-color: #2c3e50 !important;
    color: #7f8c8d !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.modal-playlist-list li.already-added-item:hover {
    background-color: #2c3e50 !important;
    color: #7f8c8d !important;
}

.modal-playlist-list li .already-added {
    color: #27ae60;
    font-size: 0.9em;
    font-weight: 500;
    float: right;
}

.modal-playlist-list li .playlist-name {
    display: inline-block;
    width: calc(100% - 80px);
}

/* ===== 새로운 메인페이지 스타일 ===== */

/* 메인 메뉴 스타일 */
.main-menu {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    padding: 0 20px;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    width: 180px;
    height: 100px;
    justify-content: center;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.menu-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: #f1c40f;
    box-shadow: 0 4px 15px rgba(241, 196, 16, 0.3);
}

.menu-icon {
    font-size: 24px;
}

.menu-text {
    font-size: 14px;
    font-weight: 500;
}

/* 콘텐츠 섹션 스타일 */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 검색 결과 스타일 */
.search-results {
    margin-top: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
}

.results-header h3 {
    color: white;
    margin: 0;
}

#results-count {
    color: #f1c40f;
    font-weight: 500;
}

/* 섹션 헤더 스타일 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.section-header h3 {
    color: white;
    margin: 0;
}

.btn-primary {
    background: #f1c40f;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #f39c12;
    transform: translateY(-1px);
}

/* 플레이리스트 목록 스타일 */
.playlists-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.playlist-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.playlist-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.playlist-card h4 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.playlist-card p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 14px;
}

/* 정렬 가능한 헤더 스타일 */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.3s ease;
}

.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sortable::after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.5;
    font-size: 12px;
}

.sortable.asc::after {
    content: '↑';
    opacity: 1;
    color: #f1c40f;
}

.sortable.desc::after {
    content: '↓';
    opacity: 1;
    color: #f1c40f;
}

/* 검색 컨테이너 개선 */
.search-container {
    margin-bottom: 20px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#search-input {
    flex: 2;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #444;
    color: white;
    font-size: 16px;
}

#search-input::placeholder {
    color: #999;
}

#genre-select {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #444;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

#genre-select option {
    background-color: #444;
    color: white;
}

#custom-genre-input {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #444;
    color: white;
    font-size: 16px;
}

#custom-genre-input::placeholder {
    color: #999;
}

#search-submit-btn {
    padding: 12px 20px;
    background: #f1c40f;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#search-submit-btn:hover {
    background: #f39c12;
    transform: translateY(-1px);
}

/* 오디오 플레이어 및 볼륨 컨트롤 스타일 */
.audio-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 10px 20px;
    border: none;
    box-shadow: none;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    height: 50px;
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
    box-sizing: border-box;
    overflow: hidden;
    isolation: isolate;
    contain: layout style paint;
}

.audio-player-container.visible {
    transform: translateY(0);
}

.current-song-info {
    min-width: 200px;
    max-width: 300px;
    order: 0;
    margin-right: 15px;
    display: flex;
    align-items: center;
    height: 100%;
}

.song-title-display {
    color: #e8f4fd;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    order: 2;
    height: 100%;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}

.volume-up-btn, .volume-down-btn {
    background: #f1c40f;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #333;
    font-size: 12px;
    font-weight: bold;
    display: none; /* 데스크톱에서는 기본적으로 숨김 */
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.volume-up-btn:hover, .volume-down-btn:hover {
    background: #f39c12;
    transform: scale(1.1);
}

.volume-icon {
    font-size: 1.2em;
    color: #f1c40f;
}

/* 볼륨 슬라이더 스타일은 global-audio-player.css에서 정의됨 */

/* 오디오 플레이어 스타일 - 기본 컨트롤 완전 제거됨 */

/* 커스텀 플레이어 컨트롤 */
.custom-player-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    order: 1;
    background: transparent;
    padding: 0;
    border-radius: 0;
    height: 100%;
}

.play-pause-btn {
    background: #000;
    color: #f1c40f;
    border: 2px solid #f1c40f;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.play-pause-btn:hover {
    background: #f1c40f;
    color: #000;
    transform: scale(1.1);
}

.play-pause-btn:active {
    transform: scale(0.95);
}

.time-display {
    display: flex;
    gap: 5px;
    color: #e8f4fd;
    font-size: 12px;
    min-width: 80px;
}

.progress-bar {
    flex: 1;
    position: relative;
    height: 4px;
    background: #555;
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: #f1c40f;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease, background 0.2s ease;
}

.progress-bar:hover .progress-fill {
    background: #f39c12;
}

.progress-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #f1c40f;
    border-radius: 50%;
    cursor: pointer;
}

/* 기본 HTML5 audio 컨트롤 완전 제거됨 - 커스텀 컨트롤만 사용 */

/* 반응형 디자인 */
@media (max-width: 768px) {
    /* 모바일 여백 조정 - 완전한 중앙 정렬 */
    .main-wrapper {
        padding: 0;
    }
    
    .container {
        margin: 15px auto;
        width: calc(100% - 30px);
    }
    
    /* 메인 메뉴 모바일 스타일 - 2x2 그리드 */
    .main-menu {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 15px;
        margin: 20px 0;
        padding: 0; /* container 여백과 겹치지 않도록 제거 */
    }
    
    .menu-btn {
        width: 100%;
        height: 80px;
        padding: 15px 10px;
        font-size: 12px;
    }
    
    .menu-icon {
        font-size: 20px;
    }
    
    .menu-text {
        font-size: 12px;
    }
    
    /* 검색창 모바일 스타일 */
    .search-container {
        padding: 0; /* container 여백과 겹치지 않도록 제거 */
    }
    
    .search-box {
        width: 100% !important; /* 전체 너비 사용 */
        max-width: 100%;
        flex-direction: column; /* 세로 배치 */
        gap: 15px;
    }
    
    #search-input {
        width: 100%;
        font-size: 16px; /* iOS 줌 방지 */
        padding: 15px;
    }
    
    #search-button {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    #search-input,
    #genre-select,
    #custom-genre-input,
    #search-submit-btn {
        flex: none;
        width: 100%;
        min-width: auto;
    }
    
    /* 테이블 모바일 대응 */
    .song-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .song-table {
        min-width: 600px; /* 최소 너비 보장 */
    }
    
    .song-table th,
    .song-table td {
        padding: 8px 6px; /* 패딩 줄임 */
        font-size: 14px; /* 폰트 크기 줄임 */
    }
    
    .song-table .btn {
        padding: 6px 8px; /* 버튼 패딩 줄임 */
        font-size: 12px;
        min-width: 60px;
    }
    
    /* 프로필 섹션 모바일 대응 */
    .profile-picture {
        width: 100px;
        height: 100px;
    }
    
    .profile-info h2 {
        font-size: 18px;
    }
    
    .profile-info p {
        font-size: 14px;
    }
    
    /* 오디오 플레이어 모바일 대응 */
    .audio-player-container {
        padding: 8px 10px;
        height: 55px;
        gap: 8px;
    }
    
    .current-song-info {
        min-width: 120px;
        max-width: 150px;
        margin-right: 8px;
        height: 100%;
    }
    
    .song-title-display {
        font-size: 11px;
    }
    
    .volume-controls {
        gap: 5px;
        height: 100%;
        overflow: hidden;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    
    /* 모바일에서는 슬라이더 숨기고 버튼 표시 */
    .volume-slider {
        display: none;
    }
    
    .volume-up-btn, .volume-down-btn {
        display: flex;
    }
    
    .volume-up-btn, .volume-down-btn {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .volume-display {
        font-size: 10px;
        min-width: 25px;
    }
    
    .custom-player-controls {
        gap: 8px;
        background: transparent;
        padding: 0;
        border-radius: 0;
        height: 100%;
    }
    
    .play-pause-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .time-display {
        font-size: 10px;
        min-width: 60px;
    }
    
    .progress-bar {
        height: 3px;
    }
    
    #music-player {
        width: 95%;
        padding: 10px;
    }
    
    /* 모달 모바일 대응 */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }
    
    .lyrics-content {
        max-height: 60vh;
        font-size: 14px;
    }
}

/* 매우 작은 화면 (480px 이하) */
@media (max-width: 260px) {
    /* 매우 작은 화면 여백 조정 */
    .main-wrapper {
        padding: 0;
    }
    
    .container {
        margin: 10px auto;
        width: calc(100% - 20px);
    }
    
    /* 260px 이하에서 오디오 플레이어 강제 조정 */
    .audio-player-container {
        padding: 2px 5px !important;
        height: 40px !important;
        gap: 3px !important;
        flex-wrap: wrap;
    }
    
    .current-song-info {
        min-width: 80px !important;
        max-width: 100px !important;
        margin-right: 3px !important;
        order: 0;
    }
    
    .song-title-display {
        font-size: 9px !important;
        line-height: 1.2;
    }
    
    .custom-player-controls {
        order: 1;
        flex: 1;
        min-width: 0;
        gap: 3px !important;
    }
    
    .play-pause-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        flex-shrink: 0;
    }
    
    .time-display {
        font-size: 8px !important;
        min-width: 40px !important;
        flex-shrink: 0;
    }
    
    .progress-bar {
        height: 2px !important;
        flex: 1;
        min-width: 0;
    }
    
    .volume-controls {
        order: 2;
        gap: 2px !important;
        flex-shrink: 0;
    }
    
    .volume-icon {
        font-size: 10px !important;
    }
    
    .volume-slider {
        width: 30px !important;
        height: 2px !important;
    }
    
    .volume-display {
        font-size: 8px !important;
        min-width: 15px !important;
    }
    
    /* 메인 메뉴 매우 작은 화면 스타일 */
    .main-menu {
        gap: 10px;
        margin: 15px 0;
        padding: 0; /* container 여백과 겹치지 않도록 제거 */
    }
    
    .menu-btn {
        height: 70px;
        padding: 10px 5px;
        font-size: 10px;
    }
    
    .menu-icon {
        font-size: 18px;
    }
    
    .menu-text {
        font-size: 10px;
    }
    
    /* 검색창 매우 작은 화면 스타일 */
    .search-container {
        padding: 0; /* container 여백과 겹치지 않도록 제거 */
    }
    
    .search-box {
        gap: 10px;
    }
    
    #search-input,
    #search-button {
        padding: 12px;
        font-size: 14px;
    }
    
    .song-table {
        min-width: 500px;
    }
    
    .song-table th,
    .song-table td {
        padding: 6px 4px;
        font-size: 12px;
    }
    
    .song-table .btn {
        padding: 4px 6px;
        font-size: 10px;
        min-width: 50px;
    }
    
    .profile-picture {
        width: 80px;
        height: 80px;
    }
    
    .profile-info h2 {
        font-size: 16px;
    }
    
    .profile-info p {
        font-size: 12px;
    }
    
    #music-player {
        width: 98%;
        padding: 8px;
    }
    
    .current-song-info {
        min-width: 120px;
        max-width: 150px;
    }
    
    /* 오디오 플레이어 매우 작은 화면 대응 */
    .audio-player-container {
        padding: 5px 5px;
        height: 48px;
        gap: 5px;
    }
    
    .current-song-info {
        min-width: 100px;
        max-width: 120px;
        margin-right: 5px;
    }
    
    .song-title-display {
        font-size: 10px;
    }
    
    .volume-controls {
        gap: 3px;
        overflow: hidden;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    
    /* 480px 이하에서도 슬라이더 숨기고 버튼 표시 */
    .volume-slider {
        display: none;
    }
    
    .volume-up-btn, .volume-down-btn {
        display: flex;
    }
    
    .volume-up-btn, .volume-down-btn {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
    
    .volume-display {
        font-size: 9px;
        min-width: 20px;
    }
    
    .custom-player-controls {
        gap: 5px;
        background: transparent;
        padding: 0;
        border-radius: 0;
    }
    
    .play-pause-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .time-display {
        font-size: 9px;
        min-width: 50px;
    }
    
    .progress-bar {
        height: 2px;
    }
    
    .modal-content {
        width: 98%;
        margin: 5px;
        padding: 15px;
    }
    
    .lyrics-content {
        max-height: 70vh;
        font-size: 12px;
    }
}

/* 260px 이하 특별 처리 */
@media (max-width: 260px) {
    .audio-player-container {
        padding: 4px 3px !important;
        height: 40px !important;
        gap: 2px !important;
        flex-direction: row !important;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    .current-song-info {
        min-width: 50px !important;
        max-width: 70px !important;
        margin-right: 2px !important;
        order: 0;
        flex-shrink: 0;
    }
    
    .song-title-display {
        font-size: 7px !important;
        line-height: 1.0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .custom-player-controls {
        order: 1;
        flex: 1;
        min-width: 0;
        gap: 1px !important;
        justify-content: center;
        background: transparent !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    
    .play-pause-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        flex-shrink: 0;
    }
    
    .time-display {
        font-size: 6px !important;
        min-width: 30px !important;
        flex-shrink: 0;
    }
    
    .progress-bar {
        height: 1px !important;
        flex: 1;
        min-width: 0;
    }
    
    .volume-controls {
        order: 2;
        gap: 1px !important;
        justify-content: center;
        flex-shrink: 0;
        overflow: hidden !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .volume-icon {
        font-size: 7px !important;
    }
    
    /* 374px 이하에서도 슬라이더 숨기고 버튼 표시 */
    .volume-slider {
        display: none !important;
    }
    
    .volume-up-btn, .volume-down-btn {
        display: flex !important;
    }
    
    .volume-up-btn, .volume-down-btn {
        width: 14px !important;
        height: 14px !important;
        font-size: 8px !important;
    }
    
    .volume-display {
        font-size: 6px !important;
        min-width: 10px !important;
    }
}

/* 공개/비공개 배지 스타일 */
.privacy-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 50px;
    display: inline-block;
}

.privacy-badge.public {
    background-color: #27ae60;
    color: white;
}

.privacy-badge.private {
    background-color: #e74c3c;
    color: white;
}

/* 업로더 이름 스타일 */
.uploader-name {
    color: #4a9eff;
    font-weight: 500;
    font-size: 14px;
}

/* 재생 중인 행 스타일 */
tr.playing {
    background-color: rgba(241, 196, 16, 0.2) !important;
}

tr.playing td {
    color: #f1c40f !important;
}

/* 새로운 플레이리스트 생성 섹션 스타일 */
.new-playlist-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

.new-playlist-section h4 {
    color: #f1c40f;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 500;
}

.new-playlist-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#new-playlist-name-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #444;
    color: white;
    font-size: 16px;
}

#new-playlist-name-input::placeholder {
    color: #999;
}

.btn-create-playlist {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-create-playlist:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-create-playlist:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

.existing-playlists-section h4 {
    color: #f1c40f;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 500;
}

/* 모달 내용 높이 조정 */
.modal-content {
    max-height: 80vh;
    overflow-y: auto;
}