/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #64b5f6, #42a5f5, #2196f3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.1rem;
    color: #b0b0b0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

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

.upload-area {
    border: 3px dashed #42a5f5;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: rgba(66, 165, 245, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #64b5f6;
    background: rgba(66, 165, 245, 0.1);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #2196f3;
    background: rgba(33, 150, 243, 0.15);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: #42a5f5;
    margin-bottom: 20px;
    display: block;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.upload-content p {
    color: #b0b0b0;
    margin-bottom: 30px;
}

.upload-btn {
    background: linear-gradient(45deg, #42a5f5, #2196f3);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 165, 245, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 165, 245, 0.4);
}

/* Video Section */
.video-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-container {
    position: relative;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#videoPlayer {
    width: 100%;
    height: auto;
    max-height: 500px;
    display: block;
    background: #000;
}

/* Frame Controls */
.frame-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #e0e0e0;
}

.slider-container {
    position: relative;
}

.frame-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 10px;
}

.frame-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #42a5f5, #2196f3);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(66, 165, 245, 0.3);
}

.frame-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #42a5f5, #2196f3);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(66, 165, 245, 0.3);
}

.slider-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #b0b0b0;
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.control-btn.primary {
    background: linear-gradient(45deg, #42a5f5, #2196f3);
    border-color: #42a5f5;
}

.precision-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.fps-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    width: 80px;
    text-align: center;
}

.capture-btn {
    background: linear-gradient(45deg, #4caf50, #45a049);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.capture-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Preview Section */
.preview-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-section h3 {
    margin-bottom: 20px;
    color: #e0e0e0;
    font-size: 1.3rem;
}

.preview-area {
    text-align: center;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    display: inline-block;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#previewCanvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.preview-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #b0b0b0;
    flex-wrap: wrap;
    gap: 10px;
}

.download-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.quality-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
}

.download-btn {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .precision-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .download-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .quality-select,
    .download-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .preview-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .upload-content h3 {
        font-size: 1.2rem;
    }
    
    .video-section,
    .preview-section {
        padding: 20px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-section,
.preview-section {
    animation: fadeIn 0.5s ease-out;
}

/* Estados de loading */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}


/* Method Selector - Ocultar completamente */
.method-selector {
    display: none !important;
}

/* Upload Section - Sempre visível */
.upload-section {
    display: block !important;
}

/* Instagram Section - Sempre oculta */
.instagram-section {
    display: none !important;
}

.method-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 8px;
    gap: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.method-tab {
    flex: 1;
    background: transparent;
    color: #b0b0b0;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.method-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.method-tab.active {
    background: linear-gradient(45deg, #42a5f5, #2196f3);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 165, 245, 0.3);
}

/* Instagram Section */
.instagram-section {
    margin-bottom: 20px;
}

.instagram-area {
    border: 3px dashed #e1306c;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: rgba(225, 48, 108, 0.05);
    transition: all 0.3s ease;
}

.instagram-area:hover {
    border-color: #fd5949;
    background: rgba(225, 48, 108, 0.1);
    transform: translateY(-2px);
}

.instagram-icon {
    font-size: 4rem;
    color: #e1306c;
    margin-bottom: 20px;
    display: block;
}

.instagram-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.instagram-content p {
    color: #b0b0b0;
    margin-bottom: 30px;
}

.instagram-input-container {
    display: flex;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
    align-items: center;
}

.instagram-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(225, 48, 108, 0.3);
    color: #e0e0e0;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.instagram-input:focus {
    outline: none;
    border-color: #e1306c;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.2);
}

.instagram-input::placeholder {
    color: #888;
}

.load-btn {
    background: linear-gradient(45deg, #e1306c, #fd5949);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
    white-space: nowrap;
}

.load-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 48, 108, 0.4);
}

.load-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-indicator {
    margin-top: 20px;
    color: #e1306c;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-indicator i {
    font-size: 1.2rem;
}

/* Responsividade para Instagram */
@media (max-width: 768px) {
    .method-tabs {
        flex-direction: column;
    }
    
    .method-tab {
        width: 100%;
    }
    
    .instagram-area {
        padding: 40px 15px;
    }
    
    .instagram-icon {
        font-size: 3rem;
    }
    
    .instagram-input-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .instagram-input,
    .load-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .instagram-content h3 {
        font-size: 1.2rem;
    }
    
    .instagram-content p {
        font-size: 0.9rem;
    }
    
    .instagram-input,
    .load-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* Animação para transição entre seções */
.upload-section,
.instagram-section {
    animation: fadeIn 0.5s ease-out;
}

/* Estado de erro para input do Instagram */
.instagram-input.error {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.instagram-input.error:focus {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2);
}

/* Mensagem de erro */
.error-message {
    color: #f44336;
    font-size: 0.9rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-message i {
    font-size: 1rem;
}

