@charset "UTF-8";

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--font-color);
    padding-top: 20px; /* Space for fixed header */
}

.main-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

/* Video Looper Tool Styles */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    color: var(--font-color);
    margin-bottom: 10px;
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.video-looper-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-background);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--hover-background);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.upload-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Settings Section */
.settings-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.settings-card h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    max-width: 200px;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-background);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Preview Section */
.preview-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center; /* Center content */
}

.preview-card h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

#originalVideo {
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    background: #000;
    margin: 0 auto 15px auto; /* Center video with margin */
    display: block;
}

.video-info {
    margin-top: 15px;
    padding: 15px;
    background: var(--info-background);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: left; /* Left align text content */
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Progress Section */
.progress-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.progress-card h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--progress-background);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Add animated shimmer effect */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* Add pulsing animation for when progress is active */
.progress-fill.active {
    animation: pulse 1.5s ease-in-out infinite;
}

.progress-fill.active::after {
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Add processing animation to the progress bar container */
.progress-bar.processing {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
    }
    to {
        box-shadow: 0 0 15px rgba(74, 144, 226, 0.6);
    }
}

.progress-text {
    color: var(--text-primary);
    font-weight: 500;
}

.progress-timer {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: monospace;
    text-align: center;
}

/* Result Section */
.result-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center; /* Center content */
}

.result-card h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

#resultVideo {
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    background: #000;
    margin: 0 auto 20px auto; /* Center video with margin */
    display: block;
}

/* Video Stats */
.result-stats {
    background: var(--info-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin: 15px auto 20px auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: left; /* Left align text content */
    max-width: 600px;
}

.result-stats strong {
    color: var(--text-primary);
}

/* Center buttons */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Settings button centering */
.settings-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.btn-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-background);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Settings button container - handle multiple buttons */
.settings-card .btn-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Mobile responsiveness for settings buttons */
@media (max-width: 768px) {
    .settings-card .btn-container {
        flex-direction: column;
        align-items: center;
    }
    
    .settings-card .btn-container .btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        padding: 15px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .settings-card,
    .preview-card,
    .progress-card,
    .result-card {
        padding: 20px;
    }
    
    #originalVideo {
        max-width: 100%;
    }
    
    #resultVideo {
        max-width: 100%;
    }
    
    .video-info,
    .result-stats {
        max-width: 100%;
        font-size: 13px;
        padding: 12px;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
        max-width: 250px;
    }
    
    .btn-container {
        width: 100%;
    }
    
    .btn-container .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.5rem;
    }
    
    .settings-card,
    .preview-card,
    .progress-card,
    .result-card {
        padding: 15px;
    }
    
    .video-info,
    .result-stats {
        font-size: 12px;
        padding: 10px;
        margin: 10px auto 15px auto;
    }
    
    .upload-area {
        padding: 20px 10px;
    }
    
    .upload-icon {
        font-size: 32px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Processing info message */
.processing-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #ff9191;
    border: 1px solid #ff0000;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1616;
}

.info-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-content {
    flex: 1;
}

.info-content strong {
    color: #0d47a1;
    display: block;
    margin-bottom: 5px;
}

.info-content br {
    line-height: 1.8;
}

/* Mobile responsiveness for processing info */
@media (max-width: 768px) {
    .processing-info {
        padding: 12px;
        font-size: 13px;
        gap: 10px;
    }
    
    .info-icon {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .processing-info {
        padding: 10px;
        font-size: 12px;
        gap: 8px;
        flex-direction: column;
        text-align: center;
    }
    
    .info-icon {
        font-size: 16px;
        align-self: center;
        margin-top: 0;
        margin-bottom: 5px;
    }
    
    .info-content {
        text-align: left;
    }
}

/* Dark mode specific adjustments */
body.dark-mode .upload-area.dragover {
    background: rgba(74, 144, 226, 0.1);
}

body.dark-mode #originalVideo,
body.dark-mode #resultVideo {
    border: 1px solid var(--border-color);
}

body.dark-mode .form-input {
    background: var(--input-background);
    border-color: var(--border-color);
}

body.dark-mode .form-input:focus {
    border-color: var(--primary-color);
}
