/**
 * GIF Converter Styles
 * CSS for video to GIF conversion interface
 */

/* Import base converter styles */
@import url('converter.css');

/* GIF Converter Variables */
:root {
    --gif-primary-color: #ff6b35;
    --gif-secondary-color: #4ecdc4;
    --gif-accent-color: #ffe66d;
    --gif-success-color: #06d6a0;
    --gif-warning-color: #f72585;
    --gif-dark-color: #264653;
    --gif-light-color: #f8f9fa;
    --gif-gradient: linear-gradient(135deg, var(--gif-primary-color), var(--gif-secondary-color));
    --gif-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
    --gif-shadow-hover: 0 8px 25px rgba(255, 107, 53, 0.3);
}

/* GIF Converter Container */
.gif-converter-container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Header Styles */
.gif-converter-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.gif-converter-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
	color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.gif-converter-subtitle {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
    font-weight: 400;
}

/* Upload Section */
.gif-upload-section {
    padding: 30px 0 0;
}

.gif-upload-section .upload-area {
    border: 3px dashed var(--gif-secondary-color);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gif-upload-section .upload-area:hover {
    transform: translateY(-3px);
}

.gif-upload-section .upload-area:hover::before {
    opacity: 0.05;
}

.gif-upload-section .upload-area.dragover {
    border-color: var(--gif-success-color);
    background: linear-gradient(135deg, #ffffff 0%, #e8fff8 100%);
    transform: scale(1.02);
}

.gif-upload-section .upload-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
    background: var(--gif-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* File Info Section */
.gif-file-info-section {
    margin: 20px 0;
    padding: 20px;
    background: #d4edda;
    border-radius: 12px;
}

.gif-file-info-section .section-title {
    color: #155724;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Video Trimmer Section */
.video-trimmer-section {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 12px;
}

.video-trimmer-section .section-title {
    color: #856404;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    margin-left: auto;
}

/* Video Preview */
.video-preview-container {
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
}

.video-preview {
    width: 100%;
    height: auto;
    max-height: 400px;
    display: block;
    background: #000;
}

/* Timeline Controls */
.timeline-container {
    margin: 20px 0;
    padding: 20px 0;
}

.timeline {
    position: relative;
    height: 40px;
    background: #e9ecef;
    border-radius: 20px;
    cursor: pointer;
}

.timeline-track {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    transform: translateY(-50%);
}

.selected-range {
    position: absolute;
    top: 50%;
    height: 8px;
    background: #ff6e41;
    border-radius: 4px;
    transform: translateY(-50%);
    transition: all 0.2s ease;
}

.trim-handle {
    position: absolute;
    top: 0;
    width: 20px;
    height: 40px;
    background: var(--gif-primary-color);
    border-radius: 10px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 10px;
    transition: all 0.2s ease;
    transform: translateX(-50%);
}

.trim-handle:hover {
    background: #ff4500;
    transform: translateX(-50%) scale(1.1);
}

.trim-handle:active {
    cursor: grabbing;
    transform: translateX(-50%) scale(0.95);
}

.trim-handle .handle-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 8px;
    letter-spacing: 1px;
}

.playback-indicator {
    display: none !important;
}

/* Hoặc nếu muốn ẩn hoàn toàn */
.timeline .playback-indicator {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Trim Inputs */
.trim-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group label {
    font-weight: 600;
    color: #856404;
    margin-bottom: 8px;
    font-size: 14px;
}

.trim-input {
    width: 100%;
    padding: 8px 12px !important;
    border: 2px solid #ffeaa7;
    border-radius: 8px !important;
    text-align: center;
    font-weight: 600;
    background: white;
    transition: all 0.2s ease;
}

.trim-input:focus {
    outline: none;
    border-color: var(--gif-accent-color);
}

.input-unit {
    margin-left: 5px;
    color: #6c757d;
    font-weight: 600;
}

.duration-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--gif-primary-color);
    padding: 8px 16px;
    background: white;
    border-radius: 8px;
    border: 2px solid #ffeaa7;
}

/* Duration Warning */
.duration-warning {
    margin-top: 15px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-icon {
    font-size: 18px;
    animation: pulse 2s infinite;
}

/* GIF Options Section */
.gif-options-section {
    margin: 20px 0;
    padding: 20px;
    background: #e3f2fd;
    border-radius: 12px;
}

/* GIF Preset Buttons */
.gif-presets-group .group-title {
    color: #0277bd;
    margin-bottom: 20px;
}

.gif-preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.gif-preset-btn {
    padding: 20px;
    background: white;
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gif-preset-btn.active {
    border-color: var(--gif-primary-color);
    color: #333;
    transform: translateY(-2px);
}

.gif-preset-btn .preset-name {
    display: block;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.gif-preset-btn .preset-details {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gif-secondary-color);
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}

.gif-preset-btn.active .preset-details {
    color: var(--gif-secondary-color);
}

.gif-preset-btn .preset-desc {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    line-height: 1.3;
    position: relative;
    z-index: 2;
}

/* Advanced Options */
.gif-advanced-group {
    margin-top: 25px;
}

.gif-advanced-group .group-title {
    color: #0277bd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.advanced-options {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
}

.gif-advanced-group .advanced-options {
	border-top: none !important;
}

.advanced-options .options-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.advanced-options .form-group {
    display: flex;
    flex-direction: column;
}

.advanced-options .form-group label {
    font-weight: 600;
    color: #0277bd;
    margin-bottom: 8px;
    font-size: 14px;
}

.advanced-options .form-control {
    padding: 12px 16px;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    background: white;
    font-weight: 500;
    transition: all 0.2s ease;
}

.advanced-options .form-control:focus {
    outline: none;
    border-color: var(--gif-secondary-color);
}

.form-text {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* File Size Estimation */
.file-size-estimate {
    margin: 25px 0;
    padding: 20px;
    background: #fff8e1;
    border-radius: 12px;
    text-align: center;
}

.estimate-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.estimate-icon {
    font-size: 20px;
}

.estimate-label {
    font-weight: 600;
    color: #f57c00;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estimate-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--gif-primary-color);
    padding: 5px 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #ffecb3;
}

.estimate-value.size-warning {
    color: var(--gif-warning-color);
    border-color: #ffcdd2;
    background: #fff5f5;
    animation: pulse 2s infinite;
}

.estimate-note {
    font-size: 14px;
    color: #f57c00;
}

/* Action Buttons */
.gif-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.preview-gif-button,
.convert-to-gif-button {
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
	width: 100%;
}

.preview-gif-button {
    background: #333;
    color: white;
    border: 2px solid transparent;
}

.convert-to-gif-button {
    background: var(--vc-success-color);
    color: white;
    border: 2px solid transparent;
}

.preview-gif-button:hover,
.convert-to-gif-button:hover {
    transform: translateY(-3px);
}

.convert-to-gif-button:disabled,
.preview-gif-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-icon {
    font-size: 20px;
}

/* GIF Preview Section */
.gif-preview-section {
    margin: 20px 0;
    padding: 20px;
    background: #f3e5f5;
    border-radius: 12px;
    text-align: center;
}

.gif-preview-section .section-title {
    color: #6a1b9a;
    margin-bottom: 20px;
}

.gif-preview-container {
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
	width: 100%;
}

.gif-preview-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
	width: 100%;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px;
    color: #6a1b9a;
}

.loading-icon {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    font-weight: 600;
}

.preview-info {
    font-size: 14px;
    color: #6a1b9a;
}

.preview-info small {
	font-size: 100%;
}

.preview-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    color: #c62828;
    margin-top: 15px;
}

/* Conversion Progress */
.gif-conversion-progress-section {
    margin: 20px 0;
    padding: 20px;
    background: #fff3e0;
    border-radius: 12px;
}

.gif-conversion-progress-section .section-title {
    color: #e65100;
    margin-bottom: 20px;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-container .progress-bar {
    height: 15px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-container .progress-fill {
    height: 100%;
    background: #ffcc02;
    transition: width 0.3s ease;
    position: relative;
}

.progress-container .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e65100;
    font-weight: 600;
}

.progress-percentage {
    font-size: 18px;
    font-weight: 700;
}

/* Success Section */
.gif-success-section {
    margin: 20px 0;
    padding: 20px;
    background: #c8e6c9;
    border-radius: 12px;
    text-align: center;
}

.gif-success-section .success-title {
    color: #2e7d32;
    margin-bottom: 15px;
    font-size: 24px;
}

.gif-success-section .success-message {
    color: #388e3c;
    margin-bottom: 20px;
    font-size: 16px;
}

.gif-result-preview {
    margin: 20px 0;
    display: none;
    border-radius: 12px;
    overflow: hidden;
}

.gif-result-image {
    max-width: 100%;
    height: auto;
    display: block;
}

.success-details {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    text-align: left;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-top: 20px;
}

.download-gif-button,
.create-another-gif-button {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
	width: 100%;
}

.download-gif-button {
    background: var(--gif-success-color);
    color: white;
}

.create-another-gif-button {
    background: #6c757d;
    color: white;
}

.download-gif-button:hover,
.create-another-gif-button:hover {
    transform: translateY(-2px);
}

/* Error Section */
.gif-error-section {
    margin: 20px 0px;
    padding: 20px;
    background: #ffebee;
    border-radius: 12px;
    text-align: center;
}

.gif-error-section .error-title {
    color: #c62828;
    margin-bottom: 15px;
}

.gif-error-section .error-message {
    color: #d32f2f;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.retry-gif-button {
    background: var(--gif-warning-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
	text-align: center;
	width: 100%;
}

.retry-gif-button:hover {
    background: #e91e63;
    transform: translateY(-2px);
}

/* GIF Features Info */
.gif-converter-card {
    margin: 30px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.gif-features-info,
.gif-usage-tips {
    padding: 20px;
	background: #f7f8f9;
}

.gif-features-info h3,
.gif-usage-tips h3 {
    color: var(--gif-dark-color);
    margin-bottom: 25px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}

.features-grid,
.tips-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-item,
.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
	background: #fff;
}

.feature-item:hover,
.tip-item:hover {
    transform: translateY(-3px);
}

.feature-icon,
.tip-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 5px;
}

.feature-content,
.tip-content {
    flex: 1;
}

.feature-content strong,
.tip-content strong {
    display: block;
    color: var(--gif-dark-color);
    font-size: 16px;
    margin-bottom: 8px;
}

.feature-content p,
.tip-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

h1.gif-converter-title {
	margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gif-converter-title {
        font-size: 24px;
        flex-direction: column;
        gap: 8px;
    }
    
    .gif-preset-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .advanced-options .options-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .trim-inputs {
        gap: 15px;
        text-align: center;
    }
    
    .preview-gif-button,
    .convert-to-gif-button,
    .download-gif-button,
    .create-another-gif-button {
        width: 100%;
        justify-content: center;
    }
    
    .features-grid,
    .tips-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gif-converter-title {
        font-size: 20px;
    }
    
    .upload-icon {
        font-size: 48px;
    }
    
    .timeline {
        height: 35px;
    }
    
    .trim-handle {
        width: 18px;
        height: 35px;
    }
}

/* Animation for conversion states */
.gif-converter-container.converting {
    animation: convertingPulse 2s ease-in-out infinite;
}

@keyframes convertingPulse {
    0%, 100% { box-shadow: var(--gif-shadow); }
    50% { box-shadow: var(--gif-shadow-hover); }
}

/* Print styles */
@media print {
    .gif-converter-container {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .gif-action-buttons,
    .success-actions,
    .error-actions {
        display: none;
    }
}
    