@import url('https://cdn.rawgit.com/moonspam/NanumSquare/master/nanumsquare.css');

/* ===========================
   CSS 변수 정의
   =========================== */
:root {
    --primary-gradient-start: #ff8989;
    --primary-gradient-end: #ff5ea1;
    --bg-primary: rgba(255, 255, 255, 0.95);
    --bg-secondary: rgba(249, 250, 251, 0.5);
    --bg-white: white;
    --text-primary: #374151;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --hover-bg: rgba(102, 126, 234, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 다크모드 */
body.dark-theme {
    --primary-gradient-start: #8b5cf6;
    --primary-gradient-end: #ec4899;
    --bg-primary: rgba(31, 41, 55, 0.95);
    --bg-secondary: rgba(55, 65, 81, 0.5);
    --bg-white: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #4b5563;
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --hover-bg: rgba(139, 92, 246, 0.1);
}

/* ===========================
   리셋 및 베이스 스타일
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'NanumSquare';
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: var(--transition);
}

#video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
    mix-blend-mode: lighten;
}

/* ===========================
   메인 컨테이너
   =========================== */
.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

/* 배경 장식 요소 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.gradient-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 119, 241, 0.8), transparent);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.gradient-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(120, 119, 255, 0.8), transparent);
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

.gradient-orb-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 218, 119, 0.6), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    25% {
        transform: translateY(-30px) translateX(20px);
    }

    50% {
        transform: translateY(20px) translateX(-30px);
    }

    75% {
        transform: translateY(-20px) translateX(-20px);
    }
}

/* ===========================
   콘텐츠 카드
   =========================== */
.content-card {
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow:
        var(--shadow-lg),
        0 0 0 1px var(--border-light) inset;
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
    transition: var(--transition);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   헤더 섹션
   =========================== */
.header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
    position: relative;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin: 0 auto 0.75rem;
    mix-blend-mode :multiply;
}

.subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    /* color: var(--text-secondary); */
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.onair-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
    padding: 0.25rem 0.6rem 0.25rem 0.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff2d55, #ff5e62);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 6px 18px rgba(255, 46, 85, 0.35);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.onair-badge::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 120%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.25) 30%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.25) 70%, transparent 100%);
    animation: onair-shine 3s linear infinite;
}

@keyframes onair-shine {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }
}

.onair-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9), 0 0 10px rgba(255, 255, 255, 0.8);
    position: relative;
    animation: onair-blink 1.2s ease-in-out infinite;
}

@keyframes onair-blink {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9), 0 0 10px rgba(255, 255, 255, 0.8);
    }

    50% {
        transform: scale(0.85);
        opacity: 0.85;
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.0), 0 0 14px rgba(255, 255, 255, 0.9);
    }
}

/* 다크모드용 변환 */
body.dark-theme .onair-badge {
    background: linear-gradient(135deg, #ff375f, #ff2d55);
    box-shadow: 0 6px 18px rgba(255, 55, 95, 0.45);
}

/* Off Air 배지 */
.offair-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
    padding: 0.25rem 0.6rem 0.25rem 0.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #94a3b8, #6b7280);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 6px 18px rgba(107, 114, 128, 0.25);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.offair-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
    box-shadow: 0 0 0 0 rgba(229, 231, 235, 0.6), 0 0 6px rgba(229, 231, 235, 0.6);
}

/* 다크모드용 Off Air 변환 */
body.dark-theme .offair-badge {
    background: linear-gradient(135deg, #4b5563, #9ca3af);
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.4);
    color: #f3f4f6;
}

body.dark-theme .offair-dot {
    background: #d1d5db;
    box-shadow: 0 0 0 0 rgba(209, 213, 219, 0.55), 0 0 6px rgba(209, 213, 219, 0.55);
}

/* ===========================
   검색 섹션
   =========================== */
.search-section {
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    position: relative;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: #9ca3af;
    stroke-width: 2;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 3rem;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-gradient-start);
    box-shadow:
        var(--shadow-md),
        0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: #9ca3af;
}

.clear-button {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s ease;
    border-radius: 8px;
    display: none;
}

.clear-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
}

.clear-button.visible {
    display: block;
}

.clear-button svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* 빠른 필터 버튼 */
.quick-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-chip:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

/* ===========================
   테이블 컨테이너
   =========================== */
.table-container {
    position: relative;
    padding: 0 2rem 2rem;
}

.table-wrapper {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 400px;
    overflow-y: auto;
    position: relative;
    /* transition: height 0.3s ease, min-height 0.3s ease; */
}

/* 스크롤바 스타일링 */
.table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff898986, #ff5ea183);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff8989, #ff5ea1);
}

/* 다크모드 스크롤바 스타일링 */
body.dark-theme .table-wrapper::-webkit-scrollbar-track {
    background: #374151;
}

body.dark-theme .table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b5cf6, #ec4899);
}

body.dark-theme .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7c3aed, #db2777);
}

/* 테이블 스타일 */
.signature-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.signature-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
}

.signature-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
}

.signature-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.signature-table th.sortable:hover {
    background: rgba(102, 126, 234, 0.05);
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-indicators {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 0.5rem;
}

.sort-icon {
    width: 10px;
    height: 6px;
    fill: #d1d5db;
    transition: fill 0.2s ease;
}

.sort-active.sort-asc .sort-up,
.sort-active.sort-desc .sort-down {
    fill: #ff5ea1;
}

/* 테이블 바디 */
.signature-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    height: 50px;
}

.signature-table tbody tr:hover {
    background: var(--hover-bg);
    transform: translateX(2px);
}

.signature-table td {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: var(--transition);
}

.signature-table td:first-child {
    font-weight: 600;
    color: var(--primary-gradient-start);
    min-width: 100px;
}

/* New 뱃지 */
.new-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

/* 로딩 스피너 */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    /* Center vertically in fixed height container */
    height: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* 빈 상태 */
.empty-state {
    min-height: 400px;
    /* padding: 3rem; */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    stroke: #d1d5db;
    margin: 0 auto 1rem;
}

.empty-state p {
    color: #6b7280;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-state span {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* 유틸리티 클래스 */
.hidden {
    display: none !important;
}

/* ===========================
   푸터 섹션
   =========================== */
/* 페이지네이션 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: var(--hover-bg);
    transform: scale(1.1);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    color: var(--text-secondary);
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-number:hover {
    background: var(--hover-bg);
}

.page-number.active {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    border-color: transparent;
}

.footer-section {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.stats-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.stat-item svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.stat-item strong {
    color: #ff5ea1;
    font-weight: 600;
}

/* ===========================
   반응형 디자인
   =========================== */

/* 태블릿 (768px ~ 1023px) */
@media (max-width: 1023px) {
    .content-card {
        max-width: 700px;
    }

    .header-section {
        padding: 1.5rem 1.5rem 1rem;
    }

    .search-section,
    .table-container,
    .footer-section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* 모바일 (320px ~ 767px) */
@media (max-width: 767px) {
    html {
        font-size: 14px;
    }

    .main-container {
        padding: 0.5rem;
    }

    .content-card {
        border-radius: 16px;
        max-width: 100%;
    }

    .header-section {
        padding: 1.25rem 1rem 1rem;
    }

    .logo {
        max-width: 180px;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .search-section {
        padding: 1rem;
    }

    .search-input {
        padding: 0.75rem 2.5rem;
        font-size: 0.875rem;
    }

    .search-icon {
        width: 18px;
        height: 18px;
        left: 0.75rem;
    }

    .clear-button {
        right: 0.5rem;
    }

    .quick-filters {
        justify-content: center;
    }

    .filter-chip {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .table-container {
        padding: 0 1rem 1rem;
    }

    .table-wrapper {
        border-radius: 8px;
        height: 350px;
    }

    .signature-table th,
    .signature-table td {
        padding: 0.75rem 1rem;
    }

    .signature-table th {
        font-size: 0.75rem;
    }

    .signature-table td {
        font-size: 0.875rem;
    }

    .th-content {
        gap: 0.25rem;
    }

    .sort-indicators {
        margin-left: 0.25rem;
    }

    .new-badge {
        padding: 0.125rem 0.375rem;
        font-size: 0.5625rem;
    }

    .footer-section {
        padding: 1rem;
    }

    .stats-info {
        gap: 1rem;
        font-size: 0.75rem;
    }

    .stat-item svg {
        width: 14px;
        height: 14px;
    }

    /* 작은 모바일 화면 조정 */
    @media (max-width: 374px) {
        .search-input {
            font-size: 0.75rem;
        }

        .signature-table td:first-child {
            min-width: 80px;
        }
    }
}

/* 큰 화면 (1024px 이상) */
@media (min-width: 1024px) {
    .content-card {
        max-width: 900px;
    }

    .table-wrapper {
        height: 500px;
    }

    .header-section {
        padding: 2.5rem 3rem 2rem;
    }

    .search-section,
    .table-container,
    .footer-section {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* 초대형 화면 (1440px 이상) */
@media (min-width: 1440px) {
    .content-card {
        max-width: 1000px;
    }

    .table-wrapper {
        height: 600px;
    }
}

/* 애니메이션 감소 설정 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}