/* Custom styles for TikTok Subtitle AI */

/* Loader spinner animation */
.loader {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Input focus styles */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Button disabled state */
button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Video player styles */
video {
    max-width: 100%;
    height: auto;
    background-color: #000;
}

/* 비디오 컨트롤 패널 스타일 */
video::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.8);
}

/* 호버 시 회색 오버레이 제거 */
video::-webkit-media-controls-overlay-enclosure {
    display: none !important;
}

video::-webkit-media-controls-overlay-play-button {
    display: none !important;
}

/* Firefox용 오버레이 제거 */
video::-moz-media-controls-overlay-enclosure {
    display: none !important;
}

/* Subtitle track styles */
video::cue {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 1.2em;
    font-family: Arial, sans-serif;
    padding: 0.2em 0.5em;
    border-radius: 0.2em;
}

/* Scrollbar styles */
.overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .flex.gap-2 {
        flex-direction: column;
    }

    .flex.gap-2 button {
        width: 100%;
    }

    video::cue {
        font-size: 1em;
    }
}

/* Animation for error/success messages */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[id="error-message"],
.bg-green-50 {
    animation: slideDown 0.3s ease-out;
}

/* Hover effects for download buttons */
button svg {
    transition: transform 0.2s ease;
}

button:hover svg {
    transform: translateY(2px);
}

/* Loading state for subtitle viewer */
.animate-spin {
    animation: spin 1s linear infinite;
}

/* Better text rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading overlay styles */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    background-color: white;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 28rem;
    width: 100%;
    margin: 1rem;
    text-align: center;
}

.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-message {
    color: #374151;
    margin-top: 1rem;
}

/* Print styles */
@media print {
    #loader-overlay,
    #loading-overlay,
    #video-player-section,
    button {
        display: none !important;
    }

    #subtitle-viewer-container {
        max-height: none !important;
    }
}
