* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    max-width: 1200px;
    width: 90%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#login-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

#app-root {
    display: none;
}

#app-root.active {
    display: flex;
    flex-direction: column;
}

/* Login Page */
.login-box {
    padding: 40px;
    text-align: center;
}

.login-box h1 {
    margin-bottom: 30px;
    color: #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Swiper assets are injected by the backend for the private UI; no public vendor CSS needed. */

/* Main Container */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

header h1 {
    font-size: 24px;
}

main {
    padding: 30px;
}

/* Viewer Controls */
.viewer-controls {
    display: grid;
    grid-template-columns: minmax(220px, 320px);
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.time-selectors {
    display: flex;
    flex-direction: row;
    gap: 14px;
    margin-bottom: 24px;
    align-items: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
}

.wheel-column,
.control-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 0;
}

.wheel-column {
    min-width: 140px;
}

.wheel-column-wide {
    flex: 1.25 1 0;
    min-width: 180px;
}

.wheel-column label,
.control-group label {
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

.control-group select,
.control-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wheel-swiper {
    position: relative;
    width: 100%;
    height: 238px;
    overflow: hidden;
    border: 1px solid #d6def5;
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.05), transparent 70%),
        linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 8px 22px rgba(51, 65, 149, 0.09);
}

.wheel-swiper::before,
.wheel-swiper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: calc((100% - 38px) / 2);
    pointer-events: none;
    z-index: 2;
}

.wheel-swiper::before {
    top: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 249, 255, 0.55) 68%, rgba(247, 249, 255, 0) 100%);
}

.wheel-swiper::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 249, 255, 0.55) 68%, rgba(247, 249, 255, 0) 100%);
}

.wheel-swiper .swiper-wrapper {
    position: absolute;
    inset: 0;
    padding: 0;
    margin: 0;
}

.wheel-swiper .swiper-slide {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #51607d;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    user-select: none;
    cursor: pointer;
    transition: transform 180ms ease, opacity 180ms ease, color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
    z-index: 1;
}

.wheel-swiper .swiper-slide-active {
    color: #17324d;
    background: linear-gradient(180deg, #ffffff 0%, #eef3ff 100%);
    box-shadow: 0 6px 16px rgba(76, 85, 197, 0.16);
    font-size: 15px;
    font-weight: 700;
    transform: scale(1.04);
}

.wheel-swiper .swiper-slide-prev,
.wheel-swiper .swiper-slide-next {
    opacity: 0.88;
    transform: scale(0.97);
}

.wheel-swiper .swiper-slide:hover {
    background: rgba(102, 126, 234, 0.08);
}

.wheel-swiper .swiper-slide.swiper-slide-empty {
    color: #7a8699;
    font-style: italic;
    cursor: default;
}

.wheel-highlight {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 50%;
    height: 38px;
    margin-top: -19px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(233, 239, 255, 0.92) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
    pointer-events: none;
    z-index: 0;
}

.wheel-swiper .swiper-wrapper {
    z-index: 1;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Viewer Area */
#viewer-area {
    min-height: 400px;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
    font-size: 18px;
    color: #999;
}

/* Video Player */
#video-player {
    text-align: center;
}

#video-element {
    max-width: 100%;
    border-radius: 4px;
    margin-bottom: 20px;
}

.video-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.video-timeline input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Image Viewer */
#image-viewer {
    text-align: center;
}

#image-element {
    max-width: 100%;
    border-radius: 4px;
    margin-bottom: 15px;
}

.image-info {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
}

/* Messages */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #c53030;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .viewer-controls {
        grid-template-columns: 1fr;
    }

    .time-selectors {
        flex-direction: column;
    }

    .wheel-swiper {
        height: 220px;
    }
}

