/* Video to GIF Converter Styles */

.video-to-gif-converter {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #007bff;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #0056b3;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #d4edda 100%);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.upload-area h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.upload-area p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.file-types {
    font-size: 14px;
    color: #888;
    margin-bottom: 25px !important;
}

.browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.browse-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.btn-icon {
    font-size: 18px;
}

/* Video Section */
.video-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.video-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 25px;
    align-items: start;
}

#videoPlayer {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
    background: #000;
}

.video-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Settings Section */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.settings-section h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.setting-group {
    margin-bottom: 30px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
}

/* Time Range Controls */
.time-range-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.time-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.time-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.time-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.time-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
}

.preset-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.preset-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Output Settings */
.output-settings {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting-item label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.setting-input,
.setting-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.setting-input:focus,
.setting-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Aspect Ratio Controls */
.aspect-ratio-controls {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #007bff;
    border-color: #007bff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.preset-sizes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.size-preset {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.size-preset:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.size-preset.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Advanced Options */
.advanced-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Conversion Controls */
.conversion-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.conversion-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.convert-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.convert-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.convert-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cancel-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.cancel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Progress Section */
.progress-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    display: none;
}

.progress-section.active {
    display: block;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.progress-percentage {
    font-size: 16px;
    font-weight: 600;
    color: #007bff;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-status {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Result Section */
.result-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    display: none;
}

.result-section.active {
    display: block;
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
}

.result-header h3 {
    margin: 0 0 10px 0;
    color: #28a745;
    font-size: 24px;
    font-weight: 600;
}

.result-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.gif-preview {
    text-align: center;
    margin-bottom: 25px;
}

.gif-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.result-info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.result-info-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.result-info-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.download-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
    color: white;
    text-decoration: none;
}

.new-conversion-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.new-conversion-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Error Section */
.error-section {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

.error-section.active {
    display: block;
}

.error-title {
    color: #721c24;
    font-weight: 600;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.error-message {
    color: #721c24;
    margin: 0;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-to-gif-converter {
        padding: 15px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-icon {
        font-size: 48px;
    }
    
    .upload-area h3 {
        font-size: 20px;
    }
    
    .video-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .time-range-controls {
        grid-template-columns: 1fr;
    }
    
    .output-settings {
        grid-template-columns: 1fr;
    }
    
    .conversion-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .convert-btn,
    .cancel-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .download-btn,
    .new-conversion-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .preset-sizes {
        justify-content: center;
    }
    
    .time-presets {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-area h3 {
        font-size: 18px;
    }
    
    .upload-area p {
        font-size: 14px;
    }
    
    .settings-section,
    .video-section,
    .conversion-section,
    .progress-section,
    .result-section {
        padding: 20px;
    }
    
    .result-info {
        grid-template-columns: 1fr;
    }
    
    .time-presets,
    .preset-sizes {
        gap: 8px;
    }
    
    .preset-btn,
    .size-preset {
        font-size: 12px;
        padding: 6px 12px;
    }
}