:root {
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-main: #1d1d1f;
    --text-sub: #86868b;
    --accent: #a8d5e2;
    --success: #34c759;
    --warning: #ff9500;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 90%;
    max-width: 450px;
    margin-top: 40px;
    padding-bottom: 40px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

header p {
    font-size: 15px;
    color: var(--text-sub);
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    margin: 20px 0 10px 10px;
    text-transform: uppercase;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.12);
}

.card:active {
    transform: scale(0.98);
}

.card.full {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.4;
}

.analysis-card {
    background: rgba(168, 213, 226, 0.15);
    border: 1px solid rgba(168, 213, 226, 0.3);
}

/* 모달 스타일 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(168, 213, 226, 0.3), rgba(184, 168, 213, 0.3));
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    z-index: 1;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-sub);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.modal-body {
    padding: 24px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

input, textarea, select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    color: var(--text-main);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(168, 213, 226, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

input::placeholder, textarea::placeholder {
    color: var(--text-sub);
}

/* 버튼 스타일 - 파스텔 톤 */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #a8d5e2, #b8a8d5);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(168, 213, 226, 0.3);
    margin-top: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #9ac7d6, #a89cc9);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(168, 213, 226, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(168, 213, 226, 0.2);
}

.btn-copy {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1.5px solid #d4a5d8;
    border-radius: 12px;
    color: #9b7ba8;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #c28ec9;
    transform: translateY(-1px);
}

.btn-copy:active {
    transform: scale(0.98);
}

.result-box {
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 18px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.7;
}

.result-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.font-preview {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.font-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1.5px solid rgba(0, 0, 0, 0.04);
}

.font-item:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.font-item:active {
    transform: scale(0.98);
}

.font-item .font-name {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 6px;
    font-weight: 600;
}

.font-item .font-display {
    font-size: 17px;
    color: var(--text-main);
    word-break: break-all;
}

.tag-group {
    margin-top: 24px;
}

.tag-group h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-main);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    background: rgba(168, 213, 226, 0.2);
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 13px;
    color: #ffffff;
    border: 1px solid rgba(168, 213, 226, 0.3);
    font-weight: 500;
}

.score-card {
    background: linear-gradient(135deg, rgba(168, 213, 226, 0.2), rgba(184, 168, 213, 0.15));
    border-radius: 18px;
    padding: 28px 24px;
    margin: 20px 0;
    text-align: center;
    border: 1.5px solid rgba(168, 213, 226, 0.3);
}

.score-number {
    font-size: 52px;
    font-weight: 800;
    color: #8b7ba8;
    margin: 10px 0;
    line-height: 1;
}

.score-label {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.score-sublabel {
    font-size: 15px;
    color: var(--text-main);
    font-weight: 600;
    margin-top: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span {
    font-size: 14px;
    color: var(--text-sub);
}

.stat-row strong {
    font-size: 15px;
    color: #333;
    font-weight: 700;
}

.analysis-section {
    margin-top: 20px;
}

.analysis-section h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.metric-name {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 600;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: #8b7ba8;
}

.metric-desc {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.5;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning);
}

.badge-info {
    background: rgba(168, 213, 226, 0.2);
    color: #6b9aaa;
}

footer {
    margin-top: auto;
    padding: 20px;
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
}

/* 반응형 */
@media (max-width: 480px) {
    .container {
        width: 95%;
        margin-top: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    .modal {
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-body {
        padding: 20px;
    }

    .score-number {
        font-size: 44px;
    }
}

/* 트렌딩 오디오 테이블 스타일 */
.trending-table-wrapper {
    margin-top: 24px;
    background: rgba(255,255,255,0.9);
    border-radius: 14px;
    overflow: hidden; /* overflow-x: auto 대신 hidden */
}

.trending-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* 추가 */
}

.trending-table thead {
    background: linear-gradient(135deg, #a8d5e2, #b8a8d5);
}

.trending-table th {
    padding: 12px 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.trending-table td {
    padding: 12px 8px;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    word-break: break-word; /* 추가 */
}

.trending-table tr:last-child td {
    border-bottom: none;
}

.trending-rank {
    font-weight: 700;
    color: #a8d5e2;
    font-size: 14px;
    text-align: center;
    width: 8%; /* 고정 비율 */
}

.trending-title {
    font-weight: 600;
    color: #1d1d1f;
    width: 40%; /* 고정 비율 */
}

.trending-status {
    text-align: center;
    width: 15%; /* 고정 비율 */
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-hot {
    background: rgba(255,59,48,0.15);
    color: #ff3b30;
}

.badge-new {
    background: rgba(52,199,89,0.15);
    color: #34c759;
}

.badge-steady {
    background: rgba(0,113,227,0.15);
    color: #0071e3;
}

.trending-feature {
    color: #86868b;
    font-size: 12px;
    width: 37%; /* 고정 비율 */
    line-height: 1.4; /* 추가 */
}

.modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

/* 모달 스크롤바 숨기기 */
.modal::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.modal {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;

    /* 스크롤바 완전히 숨기기 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE, Edge */
}

/* Webkit 브라우저 (Chrome, Safari) 스크롤바 숨기기 */
.modal::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}