/* ===== Reset & Variables ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent-violet: #4338ca;
    --accent-gradient: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    --accent-pink: #ec4899;
    --accent-pink-gradient: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
    
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f4f5;
    --text-primary: #1e1b4b;
    --text-secondary: #4c4878;
    --text-tertiary: #94a3b8;
    
    --border: #e2e8f0;
    --shadow-md: 0 4px 16px rgba(79, 70, 229, 0.08);
    --shadow-lg: 0 8px 30px rgba(79, 70, 229, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    
    --status-ongoing: #10b981;
    --status-upcoming: #6366f1;
    --status-ended: #94a3b8;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-center {
    display: flex;
    justify-content: center;
    flex: 1;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.logo-link { text-decoration: none; }

.logo-main {
    font-size: 17px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-divider { color: #d1d5db; margin: 0 4px; }
.logo-sub { color: #64748b; font-weight: 500; font-size: 15px; }

.db-count {
    padding: 4px 10px;
    background: var(--accent-pink-gradient);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

.update-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.update-time-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 24px;
    padding: 16px 0;
}

.view-tabs { display: flex; gap: 6px; }

.view-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
}

.view-tab:hover { color: var(--accent-violet); background: #eef2ff; }
.view-tab.active { background: var(--accent-gradient); color: #ffffff; }

/* ===== Main ===== */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== About Section ===== */
.about-section {
    background: linear-gradient(135deg, #fdf2f8 0%, #f0f4ff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.about-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.about-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.about-stats {
    display: flex;
    gap: 20px;
}

.about-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.about-stat-icon { font-size: 13px; opacity: 0.7; }
.about-stat-num { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.about-stat-label { font-size: 12px; color: var(--text-tertiary); }

/* ===== Filters ===== */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover { border-color: var(--accent-violet); }
.filter-btn.active { background: var(--accent-gradient); color: #fff; border-color: transparent; }

.filter-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.filter-result {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: right;
    padding-right: 4px;
}

/* ===== Performance Table ===== */
.performance-table-wrap {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.performance-table {
    width: 100%;
    border-collapse: collapse;
}

.performance-table thead {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.performance-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.performance-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: var(--transition);
}

.performance-table tbody tr:last-child { border-bottom: none; }
.performance-table tbody tr:hover { background: #f8faff; }

.performance-table td {
    padding: 6px 14px;
    vertical-align: middle;
}

/* Column widths */
.col-num { width: 50px; text-align: center; }
.col-poster { width: 70px; }
.col-title { min-width: 180px; }
.col-artist { min-width: 150px; }
.col-venue { width: 160px; }
.col-date { width: 110px; }
.col-status { width: 60px; }

/* Cell styles */
.cell-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: center;
}

.cell-poster {
    width: 60px;
    height: 90px;
    border-radius: 8px;
    background: #f1f5f9;
    overflow: hidden;
}

.cell-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cell-poster .no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 20px;
}

.cell-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.title-main {
    font-size: inherit;
    font-weight: inherit;
}

.title-artist-mobile {
    display: none;
}

.title-date-mobile {
    display: none;
}

.status-badge-inline {
    display: none;
}

.cell-venue {
    font-size: 13px;
    color: var(--text-secondary);
}

.cell-artist {
    font-size: 13px;
    color: var(--text-secondary);
}

.cell-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.cell-status {
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 11px;
}

.status-badge.ongoing {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-ongoing);
}

.status-badge.upcoming {
    background: rgba(99, 102, 241, 0.1);
    color: var(--status-upcoming);
}

.status-badge.ended {
    background: rgba(148, 163, 184, 0.1);
    color: var(--status-ended);
}

/* ===== Loading ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-tertiary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-violet);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Performance Grid ===== */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.performance-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.performance-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-violet);
}

.card-poster {
    width: 100%;
    aspect-ratio: 3/4;
    background: var(--bg-tertiary);
    overflow: hidden;
    position: relative;
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-poster .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 48px;
}

.card-status {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.card-status.ongoing {
    background: var(--status-ongoing);
    color: #fff;
}

.card-status.upcoming {
    background: var(--status-upcoming);
    color: #fff;
}

.card-status.ended {
    background: var(--status-ended);
    color: #fff;
}

.card-content {
    padding: 14px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.card-artist {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.card-artist::before {
    content: '🎤';
    font-size: 10px;
    margin-right: 4px;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-venue, .card-date {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-venue::before { content: '📍'; font-size: 10px; }
.card-date::before { content: '📅'; font-size: 10px; }

/* ===== Calendar View ===== */
.calendar-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-nav {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-nav:hover {
    background: var(--bg-tertiary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 100%;
    table-layout: fixed;
}

.calendar-day-header {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.calendar-day {
    min-height: 80px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    overflow: hidden;
}

.calendar-day.other-month {
    background: var(--bg-tertiary);
    opacity: 0.5;
}

.calendar-day.today {
    border-color: var(--accent-violet);
    background: #eef2ff;
}

.calendar-day-num {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.calendar-event {
    padding: 2px 2px;
    background: #e8e0f0;
    color: #5b4b8a;
    border-radius: 3px;
    font-size: 11px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}

.calendar-event span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event-poster {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.calendar-event:hover {
    background: #d8cce8;
}

.calendar-more {
    font-size: 10px;
    color: var(--accent-violet);
    cursor: pointer;
    padding: 2px 4px;
    margin-top: 2px;
}

.calendar-more:hover {
    text-decoration: underline;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    max-width: 950px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    color: #333;
    transition: var(--transition);
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    display: flex;
    gap: 0;
}

.modal-poster {
    width: 50%;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.modal-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.modal-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    background: var(--status-upcoming);
    color: #fff;
    align-self: flex-start;
}

.modal-status.ongoing { background: var(--status-ongoing); }
.modal-status.ended { background: var(--status-ended); }

.modal-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.4;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: auto;
}

.info-row {
    display: flex;
    gap: 12px;
}

.info-label {
    width: 90px;
    font-size: 14px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.info-icon {
    filter: grayscale(100%);
    opacity: 0.7;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.action-row {
    display: flex;
    flex-direction: row !important;
    gap: 10px;
    width: 100%;
}

.action-row .action-btn {
    flex: 1;
    min-width: 0;
}

.action-btn {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    box-sizing: border-box;
}

.action-btn img {
    width: 16px;
    height: 16px;
}

.action-btn.primary {
    background: var(--accent-gradient);
    color: #fff;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
}

.action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.action-btn.secondary:hover {
    background: var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
    }
    
    .header-left { order: 1; flex: 1; }
    .header-right { order: 2; flex: 0; }
    .header-center { order: 3; flex: 100%; justify-content: flex-start; }
    
    .main-container { padding: 16px; }
    
    .about-section { padding: 16px; }
    .about-header h2 { font-size: 15px; }
    .about-desc { font-size: 12px; }
    .about-stats { gap: 12px; flex-wrap: wrap; }
    
    .filter-divider { display: none; }
    .filter-bar { gap: 6px; }
    .filter-btn { padding: 5px 10px; font-size: 11px; }
    
    /* 테이블 모바일 - 장소, 상태, 아티스트 컬럼 숨김 */
    .col-venue,
    .cell-venue,
    .col-status,
    .cell-status,
    .col-artist,
    .cell-artist { display: none !important; }
    
    /* 제목 아래 아티스트 표시 */
    .title-artist-mobile {
        display: block !important;
        font-size: 10px;
        font-weight: 400;
        color: var(--text-secondary);
        margin-top: 4px;
    }
    
    /* 제목 옆 상태 태그 */
    .status-badge-inline {
        display: inline-block !important;
        padding: 2px 5px;
        border-radius: 3px;
        font-size: 9px;
        font-weight: 500;
        margin-left: 6px;
        vertical-align: middle;
    }
    
    .status-badge-inline.ongoing {
        background: rgba(16, 185, 129, 0.1);
        color: var(--status-ongoing);
    }
    
    .status-badge-inline.upcoming {
        background: rgba(99, 102, 241, 0.1);
        color: var(--status-upcoming);
    }
    
    .status-badge-inline.ended {
        background: rgba(148, 163, 184, 0.1);
        color: var(--status-ended);
    }
    
    .performance-table {
        table-layout: fixed;
        width: 100%;
    }
    
    .performance-table th, 
    .performance-table td { 
        padding: 8px 2px;
        vertical-align: middle;
        overflow: hidden;
    }
    
    .performance-table th { 
        font-size: 10px; 
    }
    
    /* 비율 기반 컬럼 너비 - 4컬럼 */
    .col-num { width: 24px; text-align: center !important; }
    .col-poster { width: 48px; }
    .col-title { width: auto; }
    .col-date { width: 72px; }
    
    .cell-num { text-align: center; font-size: 11px; }
    .cell-poster { width: 42px; height: 56px; }
    .cell-title { 
        font-size: 12px !important;
        font-weight: 600;
    }
    .cell-date { 
        font-size: 10px !important;
    }
    
    /* 모바일 모달 - 전체화면 */
    .modal-overlay {
        padding: 0;
        align-items: stretch;
    }
    
    .modal {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .modal-body {
        flex-direction: column;
        flex: 1;
        overflow-y: auto;
    }
    
    .modal-poster {
        width: 100%;
        height: 45vh;
        min-height: 300px;
        flex-shrink: 0;
        background: #000;
    }
    
    .modal-poster img {
        object-fit: contain;
        width: 100%;
        height: 100%;
    }
    
    .modal-close {
        top: 12px;
        right: 12px;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .modal-info {
        padding: 20px;
        flex: 1;
    }
    
    .modal-status {
        padding: 5px 12px;
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .modal-name {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .info-list {
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .info-label {
        width: 70px;
        font-size: 13px;
    }
    
    .info-value {
        font-size: 13px;
    }
    
    .modal-actions {
        gap: 8px;
    }
    
    .action-btn {
        padding: 12px 16px;
        font-size: 13px;
        height: 46px;
    }
    
    .action-row {
        flex-direction: row !important;
    }
    
    .calendar-day { min-height: 60px; padding: 4px; }
    .calendar-event { font-size: 9px; }
}

@media (max-width: 480px) {
    .header-left { gap: 8px; }
    .logo-sub { display: none; }
    .logo-divider { display: none; }
    
    .main-container { padding: 12px; }
    
    /* 기간 컬럼은 유지, 날짜 모바일 표시 숨김 */
    .title-date-mobile { display: none !important; }
    
    .col-num { width: 28px; }
    .cell-num { font-size: 11px; }
    .cell-poster { width: 38px; height: 50px; }
    .cell-title { font-size: 11px !important; }
    .cell-date { font-size: 9px !important; }
    
    .update-time { display: none; }
    
    /* 모바일 모달 추가 조정 */
    .modal-poster {
        height: 240px;
    }
    
    .modal-info {
        padding: 16px;
    }
    
    .modal-name {
        font-size: 16px;
    }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 14px;
}
