/* YouTube Audio Extractor - Main Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding-top: 80px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    z-index: 1000;
    padding: 0 20px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    position: relative;
}


/* Navbar progress bar */
.navbar-progress-bar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0 0 8px 8px;
    padding: 12px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    z-index: 1001;
    min-width: 300px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.navbar-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.navbar-progress-text {
    font-size: 0.85em;
    color: #333;
    font-weight: 500;
}

.navbar-progress-counter {
    font-size: 0.8em;
    color: #666;
}

.navbar-progress-container {
    background: #e9ecef;
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
}

.navbar-progress-fill {
    background: linear-gradient(90deg, #4CAF50, #45a049);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}

/* Show navbar progress bar when has-progress-bar class is active */
.nav-logo.has-progress-bar .navbar-progress-bar {
    display: block !important;
}

/* Background progress bar for downloads page */
.background-progress-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #4CAF50;
    animation: slideIn 0.4s ease-out;
}

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

.progress-title {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.progress-status {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

.progress-bar-container {
    background: #e9ecef;
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #4CAF50, #45a049);
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.progress-details {
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
}

.progress-details .status-text {
    color: #555;
    font-size: 0.9em;
    font-style: italic;
}


.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 30px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.mode-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    color: #495057;
    opacity: 1;
    visibility: visible;
}

.mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.form-section {
    margin-bottom: 25px;
}

.website-section .input-group input[type="url"],
.website-section .input-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    min-height: 100px;
    resize: vertical;
}

.content-type-selector {
    margin: 20px 0;
}

.content-type-selector h4 {
    margin-bottom: 10px;
    color: #495057;
}

.content-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.content-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s;
}

.content-options label:hover {
    background: #e9ecef;
}

.website-content {
    margin-top: 20px;
}

.content-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.content-section h4 {
    margin-bottom: 15px;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.content-item {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.content-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.video-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.video-thumbnail {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
    background: #f8f9fa;
    display: block;
}

/* Thumbnails na lista de vídeos de websites */
.content-item .video-thumbnail {
    width: 100px;
    height: 150px;
}

.video-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.content-title {
    font-weight: 600;
    color: #495057;
    flex: 1;
}

.content-meta {
    font-size: 12px;
    color: #6c757d;
    margin-left: 25px;
    margin-top: 5px;
}

.selection-controls {
    margin: 20px 0;
    text-align: center;
    padding: 15px;
    background: #e9ecef;
    border-radius: 8px;
}

.selection-controls button {
    margin: 0 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.selection-controls button:first-child {
    background: #28a745;
    color: white;
}

.selection-controls button:first-child:hover {
    background: #218838;
}

.selection-controls button:last-child {
    background: #dc3545;
    color: white;
}

.selection-controls button:last-child:hover {
    background: #c82333;
}

.preview-btn {
    margin-left: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 3px;
    text-transform: none;
    letter-spacing: 0.2px;
    width: auto;
    min-width: fit-content;
}

.preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6c5ce7 100%);
}

.preview-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.video-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

.video-preview.show {
    display: block;
}

.video-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

/* Thumbnails para preview (YouTube e Website) */
.video-preview .video-thumbnail {
    width: 120px;
    height: 90px;
    border: 1px solid #dee2e6;
}

.video-info h3 {
    color: #333;
    margin-bottom: 8px;
}

.video-meta {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.quality-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.control-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.control-group h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.quality-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quality-option {
    display: none;
}

.quality-option + label {
    display: block;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.quality-option:checked + label {
    border-color: #667eea;
    background: #f3f2ff;
    color: #667eea;
}

.quality-option + label:hover {
    border-color: #a29bfe;
}

.format-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quality-label {
    font-weight: bold;
    display: block;
}

.quality-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.quality-size {
    font-size: 11px;
    color: #999;
}

.estimated-size {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.estimated-size.show {
    display: block;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
    background: #e8f3ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    min-height: 120px;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.url-help {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

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

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.progress-container {
    margin-top: 20px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

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

.batch-info {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    display: none;
}

/* Progresso de playlist melhorado */
.playlist-progress {
    background: #e8f4fd;
    border: 1px solid #b3d4fc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.playlist-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c5aa0;
}

.playlist-bar {
    height: 8px;
    background: #d1ecf1;
    border-radius: 4px;
}

.playlist-bar .progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
}

/* Progresso simples para vídeos únicos */
.simple-progress {
    margin-bottom: 10px;
}

.results-container {
    margin-top: 20px;
    display: none;
}

.results-summary {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.results-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    width: auto;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.result-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #28a745;
}

.result-item.failed {
    border-left-color: #dc3545;
}

.result-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.result-meta {
    font-size: 12px;
    color: #666;
}

.download-actions {
    margin-top: 20px;
    text-align: center;
    display: none;
}

.download-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin: 5px;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #218838;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

/* Estilos para interface de séries */
.series-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.series-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    font-weight: 600;
}

.series-info p {
    margin: 0 0 15px 0;
    opacity: 0.9;
    font-size: 1.1em;
}

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

.series-select-all-btn, .series-deselect-all-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.series-select-all-btn {
    background: #28a745;
    color: white;
}

.series-select-all-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.series-deselect-all-btn {
    background: #dc3545;
    color: white;
}

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

/* Melhorias para episódios de série */
.content-item input[type="checkbox"]:checked + .video-info {
    border-left: 4px solid #667eea;
    background: rgba(102, 126, 234, 0.05);
}
