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

html {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #0f0f23;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100dvh;
    overflow: hidden;
    margin: 0 auto;
}

@supports not (height: 100dvh) {
    body {
        height: 100vh;
    }
}

.container {
    height: 100dvh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

@supports not (height: 100dvh) {
    .container {
        height: 100vh;
    }
}

.header {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

.title-container {
    position: relative;
}

.title {
    position: relative;
    display: inline-block;
    font-size: 3rem;
    font-weight: bold;
    color: #9146ff;
    margin-bottom: 5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

.title-underline {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 20px;
    pointer-events: none;
    z-index: 1;
}

.subtitle {
    font-size: 1.4rem;
    color: #b3b3b3;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.chart-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.chart-container::-webkit-scrollbar {
    height: 12px;
}

.chart-container::-webkit-scrollbar-track {
    background: #18181b;
    border-radius: 6px;
}

.chart-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #9146ff, #b366ff);
    border-radius: 6px;
    border: 2px solid #18181b;
}

.chart-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #a855ff, #c084ff);
}

.chart-container {
    scrollbar-width: thin;
    scrollbar-color: #9146ff #18181b;
}

canvas {
    background-color: transparent;
    border-radius: 8px;
    height: 100% !important;
    max-height: 100% !important;
    min-width: 1000px !important;
    cursor: default;
    flex-shrink: 0;
}

.tooltip {
    background-color: #1f1f23;
    border: 2px solid #9146ff;
    border-radius: 8px;
    padding: 12px;
    color: #ffffff;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(145, 70, 255, 0.3);
}

.tooltip-player {
    font-weight: bold;
    color: #9146ff;
    font-size: 18px;
}

.tooltip-time {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin: 4px 0;
}

.tooltip-date {
    color: #b3b3b3;
    font-size: 12px;
}

.tooltip-link {
    color: #9146ff;
    text-decoration: none;
    font-size: 12px;
    margin-top: 8px;
    display: inline-block;
    pointer-events: auto;
    cursor: pointer;
}

.tooltip-link:hover {
    text-decoration: underline;
}

.feedback-link {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #b3b3b3;
    text-decoration: none;
    font-size: 12px;
    z-index: 1000;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.feedback-link:hover {
    opacity: 1;
    color: #9146ff;
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background-color: #1f1f23;
    margin: 2% auto;
    padding: 0;
    border: 2px solid #9146ff;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    box-shadow: 0 8px 32px rgba(145, 70, 255, 0.3);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(90deg, #9146ff, #b366ff);
    color: white;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: color 0.2s ease;
}

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

.modal-body {
    padding: 0;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-loading,
.video-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    color: white;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #9146ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.video-error a {
    color: #9146ff;
    text-decoration: none;
}

.video-error a:hover {
    text-decoration: underline;
}

/* Mobile responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 12px 16px;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .modal-close {
        font-size: 24px;
    }
    
    .header {
        top: 0;
    }
}
