/* 전역 스타일 */
:root {
    --bg-dark: #121212;
    --bg-darker: #0a0a0a;
    --bg-medium: #1e1e1e;
    --bg-light: #2d2d2d;
    --text-light: #e1e1e1;
    --text-medium: #b0b0b0;
    --text-dark: #707070;
    --highlight: #ff8800; /* 형광 주황색 */
    --highlight-dark: #e07800;
    --highlight-light: #ff9a33;
    --highlight-transparent: rgba(255, 136, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 헤더 스타일 */
header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.highlight {
    color: var(--highlight);
    text-shadow: 0 0 10px rgba(255, 136, 0, 0.7);
    animation: glow 2s infinite;
}

/* 디바이스 정보 */
.device-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.mobile-view-info, .desktop-view-info {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    margin: 0 0.25rem;
}

.mobile-view-info {
    display: none;
}

.desktop-view-info {
    display: inline-block;
}

@keyframes glow {
    0% {
        text-shadow: 0 0 10px rgba(255, 136, 0, 0.7);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 136, 0, 0.9), 0 0 30px rgba(255, 136, 0, 0.3);
    }
    100% {
        text-shadow: 0 0 10px rgba(255, 136, 0, 0.7);
    }
}

/* 테이블 스타일 */
.table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    background-color: var(--bg-medium);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

th, td {
    padding: 0.75rem 1rem;
}

th {
    background-color: var(--bg-darker);
    font-weight: 600;
    text-align: left;
}

th:first-child, td:first-child {
    text-align: left;
}

tr {
    border-bottom: 1px solid var(--bg-light);
}

tbody tr:hover {
    background-color: var(--bg-light);
}

tr.selected {
    background-color: var(--bg-light);
}

/* 백분위 경계선 및 마커 스타일 */
tr.percentile-boundary {
    border-top: 2px solid var(--highlight);
}

tr.percentile-marker {
    background-color: var(--highlight-transparent);
    border: none;
}

.percentile-marker-cell {
    padding: 0.25rem 1rem;
    text-align: center !important;
    color: var(--highlight);
    font-weight: bold;
    font-size: 0.9rem;
}

.percentile-label {
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: 1rem;
    background-color: var(--highlight-transparent);
    box-shadow: 0 0 10px rgba(255, 136, 0, 0.3);
}

.salary-cell a {
    color: var(--highlight);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.salary-cell a:hover {
    color: var(--highlight-light);
}

/* 툴팁 말풍선 스타일 */
.tooltip {
    position: fixed;
    width: 500px;
    background-color: var(--bg-medium);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
}

.tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip.mobile {
    width: calc(100% - 20px) !important;
    max-width: none !important;
    left: 10px !important;
    right: 10px !important;
    top: 50px !important;
    max-height: calc(100vh - 60px) !important;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-darker);
    padding: 1rem;
    border-bottom: 1px solid var(--bg-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.tooltip-header span.highlight {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-tooltip {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-medium);
    transition: color 0.2s;
}

.close-tooltip:hover {
    color: var(--highlight);
}

.tooltip-content {
    padding: 1rem;
}

/* 백분위 정보 */
.percentile-info {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-light);
}

.percentile-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--highlight);
}

/* 급여 세부 정보 스타일 (모바일 전용) */
.salary-details {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-light);
    display: none;
}

.salary-details.visible {
    display: block;
}

.salary-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--highlight);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.detail-table th, .detail-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--bg-light);
}

.detail-table th {
    font-weight: 500;
    color: var(--text-medium);
    background-color: transparent;
    width: 40%;
}

.detail-table td {
    font-weight: 600;
}

/* 백분위 툴팁 스타일 */
.mini-tooltip {
    position: fixed;
    width: 120px;
    background-color: var(--highlight);
    color: white;
    font-weight: bold;
    border-radius: 4px;
    padding: 5px 10px;
    text-align: center;
    font-size: 0.8rem;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    pointer-events: none; /* 마우스 이벤트가 툴팁을 통과하도록 */
}

.mini-tooltip:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--highlight);
}

.mini-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 오버레이 배경 */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 댓글 개수 표시 배지 */
.comment-indicator {
    display: none;
    position: relative;
    margin-left: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: var(--highlight);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 rgba(255, 136, 0, 0.4);
    animation: pulse 1.5s infinite;
}

.comment-indicator.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-indicator.double-digits {
    width: 1.5rem;
    font-size: 0.7rem;
}

.comment-indicator.hot {
    background-color: #ff3300;
    animation: hot-pulse 1.5s infinite;
}

.comment-indicator:after {
    content: attr(data-count);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 136, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 136, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 136, 0, 0);
    }
}

@keyframes hot-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 51, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(255, 51, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 0, 0);
    }
}

/* 댓글 관련 스타일 */
.comment-list {
    margin-bottom: 2rem;
}

.comment-list h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--highlight);
}

.comment-item {
    background-color: var(--bg-light);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    list-style: none;
}

.comment-item small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-dark);
    font-size: 0.85rem;
}

.comment-form textarea {
    width: 100%;
    background-color: var(--bg-light);
    border: none;
    border-radius: 0.5rem;
    color: var(--text-light);
    padding: 1rem;
    height: 100px;
    margin-bottom: 1rem;
    resize: vertical;
}

.comment-form textarea:focus {
    outline: 2px solid var(--highlight);
}

.comment-form button {
    background-color: var(--highlight);
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-form button:hover {
    background-color: var(--highlight-dark);
}

/* 연봉 셀 스타일 */
.salary-cell .salary-trigger {
    cursor: pointer;
    color: var(--highlight);
    font-weight: 500;
    transition: color 0.2s, text-shadow 0.2s;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.salary-cell .salary-trigger:hover {
    color: var(--highlight-light);
    text-shadow: 0 0 10px rgba(255, 136, 0, 0.4);
    background-color: rgba(255, 136, 0, 0.1);
}

.salary-cell .salary-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* 푸터 스타일 */
footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-dark);
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-medium);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--highlight);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    /* 기본 스타일 조정 */
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .table-container {
        margin: 0 -1rem;
        border-radius: 0;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.5rem;
    }

    /* 디바이스 정보 표시 */
    .mobile-view-info {
        display: inline-block;
    }

    .desktop-view-info {
        display: none;
    }

    /* 모바일에서 특정 컬럼 숨기기 */
    .desktop-only {
        display: none;
    }

    /* 모바일에서만 보이는 컨텐츠 */
    .mobile-only {
        display: block;
    }

    /* 툴팁 스타일 모바일 최적화 */
    .tooltip {
        border-radius: 0.5rem;
        overflow-y: auto;
    }

    .tooltip-header span.highlight {
        font-size: 1.1rem;
    }

    /* 백분위 마커 스타일 조정 */
    .percentile-marker-cell {
        font-size: 0.8rem;
    }

    .percentile-label {
        padding: 0.2rem 0.75rem;
        font-size: 0.8rem;
    }

    /* 세부 정보 테이블 스타일 조정 */
    .detail-table th, .detail-table td {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
}

/* 태블릿 디자인 (중간 화면) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }

    table {
        font-size: 0.95rem;
    }

    th, td {
        padding: 0.6rem 0.8rem;
    }
}