/* 기본 리셋 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 슬라이더 스타일 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #dc3545 0%, #ffc107 23%, #28a745 100%);
    border-radius: 5px;
    outline: none;
}

/* 슬라이더 마커 스타일 */
.slider-markers span {
    font-weight: 500;
    user-select: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 기본 레이아웃 스타일 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8em;
    font-weight: 300;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.container {
    max-width: 1800px;
    margin: 20px auto;
    padding: 0 20px;
}

.controls {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.table-select {
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1em;
}

.sort-info {
    color: #666;
    font-size: 0.9em;
}

.video-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 1600px;
    margin: 0 auto;
}

/* 테이블 스타일 */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
}

th:hover {
    background: #e9ecef;
}

th.sortable::after {
    content: '↕';
    position: absolute;
    right: 10px;
    color: #999;
}

th.sorted-asc::after {
    content: '↑';
    color: #667eea;
}

th.sorted-desc::after {
    content: '↓';
    color: #667eea;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: top;
}

tr:hover {
    background: #f8f9fa;
}

.video-title-modal {
    font-weight: 500;
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.video-title-modal:hover {
    color: #667eea;
}

.video-id {
    color: #667eea;
    text-decoration: none;
    font-family: monospace;
    font-size: 0.9em;
}

.video-id:hover {
    text-decoration: underline;
}

.stats {
    font-weight: 500;
}

.view-count {
    color: #28a745;
}

.like-count {
    color: #dc3545;
}

.date {
    color: #666;
    font-size: 0.9em;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 모달 스타일 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px 24px 28px;
    min-width: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    position: relative;
    max-width: 90vw;
}

.modal-content h2 {
    margin-bottom: 18px;
    font-size: 1.2em;
    color: #764ba2;
}

.modal-content label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.modal-content input[type="text"],
.modal-content input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 16px;
    border: 1.5px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1em;
}

.modal-content textarea {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 16px;
    border: 1.5px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1em;
    resize: none;
}

.modal-content .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-content button {
    padding: 8px 18px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
}

.modal-content .close-btn {
    background: #6c757d;
    color: #fff;
}

.modal-content .submit-btn {
    background: #764ba2;
    color: #fff;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .video-table {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
}

/* 슬라이더 마커 스타일 (정확한 위치) */
.slider-markers-abs {
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    height: 18px;
    pointer-events: none;
}

.slider-markers-abs span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: #666;
    font-weight: 500;
    user-select: none;
}
