body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #0f1420;
    color: #ffffff;
}

.visualize-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.visualize-title {
    text-align: center;
    margin-bottom: 30px;
}

.visualize-table-container {
    overflow-x: auto;
}

.visualize-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.visualize-table th, .visualize-table td {
    border: 1px solid #2c3e50;
    padding: 10px;
    text-align: left;
}

.visualize-table th {
    background-color: #2c3e50;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: #1a202c;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 10px 15px;
    font-weight: bold;
}

.card-category {
    float: right;
    font-weight: normal;
}

.card-body {
    padding: 15px;
}

.card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.card-body p {
    margin: 5px 0;
    color: #a0a0a0;
}

.media-count {
    float: right;
}

.card-md5 {
    font-size: 12px;
    word-break: break-all;
    color: #6c757d;
}

.button-container {
    text-align: center;
}

.analyze-button {
    background-color: #3498db;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.analyze-button:hover {
    background-color: #2980b9;
}

.loading-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 20, 32, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid transparent;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-content p {
    color: #ffffff;
    font-size: 18px;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
    font-size: 18px;
}

.chart-container {
    position: relative;
    margin: auto;
    height: 50vh;
    width: 80vw;
}

@media (max-width: 768px) {
    .chart-container {
        height: 60vh;
        width: 95vw;
    }
}

.category-analysis-title {
    text-align: center;
    margin: 40px 0 20px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.elegant-title {
    font-size: 28px;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    color: rgb(255, 99, 132); /* Strength 데이터 색상과 동일 */
    font-weight: 300;
    font-style: italic;
    text-align: center;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .elegant-title {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 14px;
    }
}

.keyword-analysis-title {
    text-align: center;
    margin: 40px 0 20px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.keyword-analysis-title .elegant-title {
    font-size: 28px;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.keyword-subtitle {
    font-size: 16px;
    color: rgb(54, 162, 235); /* Key Sum 데이터 색상과 동일 */
    font-weight: 300;
    font-style: italic;
    text-align: center;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .keyword-analysis-title .elegant-title {
        font-size: 24px;
    }
    
    .keyword-subtitle {
        font-size: 14px;
    }
}

.category-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.elegant-title {
    font-size: 24px;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0;
}

.sorting-options {
    display: flex;
}

.sorting-options label {
    margin-left: 15px;
    color: #ffffff;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.sorting-options input[type="checkbox"] {
    margin-right: 5px;
}

@media (max-width: 768px) {
    .category-analysis-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sorting-options {
        margin-top: 10px;
    }
}

.keyword-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.keyword-analysis-header .elegant-title {
    font-size: 24px;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0;
}

.keyword-analysis-header .sorting-options {
    display: flex;
}

.keyword-analysis-header .sorting-options label {
    margin-left: 15px;
    color: #ffffff;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.keyword-analysis-header .sorting-options input[type="checkbox"] {
    margin-right: 5px;
}

@media (max-width: 768px) {
    .keyword-analysis-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .keyword-analysis-header .sorting-options {
        margin-top: 10px;
    }
}

/* Focused Category Insights 스타일 */
.focused-category-insights {
    background-color: #1a202c;
    border-radius: 8px;
    padding: 15px 20px; /* 상단 패딩을 줄임 */
    margin-bottom: 20px; /* 하단 마진도 약간 줄임 */
    margin-top: 10px; /* 상단 마진 추가 */
}

.insights-title {
    font-size: 1.5em;
    color: #ffffff;
    margin-bottom: 15px; /* 타이틀 아래 마진 줄임 */
    margin-top: 0; /* 타이틀 위 마진 제거 */
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.insight-item {
    background-color: #2c3e50; /* 카드 배경색을 약간 밝게 조정 */
    padding: 15px;
    border-radius: 8px;
}

.insight-label {
    font-size: 0.9em;
    color: #a0aec0;
    margin-bottom: 5px;
}

.insight-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #ffffff;
}

.insight-subvalue {
    font-size: 0.9em;
    color: #a0aec0;
}

.insight-subvalue.positive { color: #4caf50; }
.insight-subvalue.negative { color: #f44336; }

@media (max-width: 768px) {
    .insights-grid {
        grid-template-columns: 1fr 1fr;
    }
}
