/* Subtitle Page Specific Styles */

.subtitle-description {
    color: #888;
    font-size: 1.1em;
    font-family: 'DM Sans', sans-serif;
    margin-bottom: 20px;
    text-align: center;
}

.subtitle-search-container {
    margin-bottom: 30px;
}

.search-input-container {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.subtitle-search-input {
    flex: 1;
    min-width: 300px;
    padding: 15px 20px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
}

.subtitle-search-input:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    background: #1a1a1a;
}

.subtitle-search-input::placeholder {
    color: #666;
}

.subtitle-search-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.source-dropdown-container {
    position: relative;
    display: inline-block;
}

.source-dropdown-button {
    padding: 15px 25px;
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    min-width: 180px;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.source-dropdown-button:hover {
    background: #444;
    border-color: #ffffff;
}

.source-dropdown-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.source-dropdown-content {
    display: none;
    position: absolute;
    background: #222;
    border: 1px solid #555;
    border-radius: 8px;
    min-width: 250px;
    z-index: 1000;
    top: 100%;
    left: 0;
    margin-top: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.source-dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: #333;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item input[type="checkbox"] {
    accent-color: #ffffff;
    transform: scale(1.2);
}

.dropdown-item label {
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.subtitle-search-button {
    padding: 15px 30px;
    background: #00aa00;
    border: none;
    border-radius: 8px;
    color: #000;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.subtitle-search-button:hover {
    background: #ffffff;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: translateY(-2px);
}

.subtitle-search-button:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.source-status-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.source-badge {
    background: #333;
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.source-badge.completed {
    background: #005500;
    color: #ffffff;
}

.source-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #222;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sources-loading-indicator {
    display: none;
    vertical-align: middle;
    margin-left: 10px;
}

.sources-loading-indicator.show {
    display: inline-block;
}

.sources-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #222;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.subtitle-loading {
    display: none;
    text-align: center;
    margin: 30px 0;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
}

.subtitle-loading.show {
    display: block;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #333;
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

.subtitle-results-section {
    display: none;
}

.subtitle-results-section.show {
    display: block;
}

.results-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    color: #ffffff;
    font-size: 1.5em;
    font-family: 'Kumbh Sans', sans-serif;
    font-weight: 600;
    margin: 0;
}

.results-count {
    color: #888;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
}

.results-container {
    position: relative;
}

.subtitle-results-list {
    list-style: none;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: #00aa00 #222;
}

/* Custom scrollbar for webkit browsers */
.subtitle-results-list::-webkit-scrollbar {
    width: 8px;
}

.subtitle-results-list::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}

.subtitle-results-list::-webkit-scrollbar-thumb {
    background-color: #00aa00;
    border-radius: 4px;
}

.subtitle-results-list::-webkit-scrollbar-thumb:hover {
    background-color: #ffffff;
}

.subtitle-result-item {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.subtitle-result-item:hover {
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
    transform: translateY(-2px);
}

.subtitle-result-title {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 18px;
    font-family: 'Kumbh Sans', sans-serif;
    line-height: 1.3;
}

.subtitle-result-source {
    color: #888;
    font-size: 14px;
    margin-bottom: 12px;
    font-family: 'DM Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subtitle-result-description {
    color: #ccc;
    font-size: 14px;
    line-height: 1.4;
    font-family: 'DM Sans', sans-serif;
    margin-bottom: 15px;
}

.subtitle-download-btn {
    background: #00aa00;
    border: none;
    border-radius: 6px;
    color: #000;
    padding: 10px 20px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.subtitle-download-btn:hover {
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.subtitle-download-btn:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


.scroll-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 10px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(28, 30, 48, 0) 0%, rgba(28, 30, 48, 1) 100%);
    pointer-events: none;
    opacity: 0.8;
    display: none;
    transition: opacity 0.3s ease;
}

.no-results {
    text-align: center;
    color: #666;
    padding: 60px 20px;
    font-style: italic;
    font-family: 'DM Sans', sans-serif;
}

.no-results-icon {
    margin-bottom: 20px;
    color: #555;
}

.no-results-icon svg {
    width: 48px;
    height: 48px;
}

.subtitle-console {
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-family: 'Courier New', monospace;
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: #ffffff #222;
    font-size: 12px;
}

.subtitle-console.show {
    display: block;
}

.subtitle-console::-webkit-scrollbar {
    width: 6px;
}

.subtitle-console::-webkit-scrollbar-track {
    background: #222;
    border-radius: 3px;
}

.subtitle-console::-webkit-scrollbar-thumb {
    background-color: #00aa00;
    border-radius: 3px;
}

.subtitle-console::-webkit-scrollbar-thumb:hover {
    background-color: #ffffff;
}

.console-line {
    margin-bottom: 8px;
    padding: 4px 0;
    word-wrap: break-word;
    line-height: 1.4;
}

.console-line.error {
    color: #ff4444;
}

/* Light mode styles */
body.light .subtitle-description {
    color: #666;
}

body.light .subtitle-search-input {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

body.light .subtitle-search-input:focus {
    border-color: #287bff;
    box-shadow: 0 0 10px rgba(40, 123, 255, 0.3);
    background: #fff;
}

body.light .source-dropdown-button {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

body.light .source-dropdown-button:hover {
    background: #e9e9e9;
    border-color: #287bff;
}

body.light .source-dropdown-content {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light .dropdown-item {
    border-bottom: 1px solid #eee;
}

body.light .dropdown-item:hover {
    background: #f5f5f5;
}

body.light .dropdown-item label {
    color: #333;
}

body.light .subtitle-search-button {
    background: #287bff;
    color: #fff;
}

body.light .subtitle-search-button:hover {
    background: #1a5bb8;
    box-shadow: 0 0 15px rgba(40, 123, 255, 0.3);
}

body.light .source-badge {
    background: #e9e9e9;
    color: #333;
}

body.light .source-badge.completed {
    background: #d4edda;
    color: #155724;
}

body.light .subtitle-loading {
    color: #287bff;
}

body.light .results-header h3 {
    color: #287bff;
}

body.light .subtitle-result-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

body.light .subtitle-result-item:hover {
    border-color: #287bff;
    box-shadow: 0 0 15px rgba(40, 123, 255, 0.2);
}

body.light .subtitle-result-title {
    color: #287bff;
}

body.light .subtitle-result-source {
    color: #666;
}

body.light .subtitle-result-description {
    color: #555;
}

body.light .subtitle-download-btn {
    background: #287bff;
    color: #fff;
}

body.light .subtitle-download-btn:hover {
    background: #1a5bb8;
    box-shadow: 0 0 10px rgba(40, 123, 255, 0.3);
}


body.light .subtitle-console {
    background: rgba(0, 0, 0, 0.05);
    color: #287bff;
}

body.light .no-results {
    color: #999;
}

body.light .no-results-icon {
    color: #ccc;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .subtitle-console {
        padding: 15px;
        margin-top: 20px;
    }
    
    .search-input-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .subtitle-search-input {
        min-width: 100%;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .source-dropdown-button {
        min-width: 100%;
        justify-content: center;
    }
    
    .subtitle-search-button {
        width: 100%;
        padding: 15px;
    }
    
    .subtitle-results-list {
        max-height: 400px;
    }
    
    .subtitle-result-item {
        padding: 15px;
    }
    
    .subtitle-result-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .subtitle-console {
        padding: 12px;
        margin-top: 15px;
        font-size: 11px;
    }
    
    .subtitle-results-list {
        max-height: 300px;
    }
    
    .subtitle-result-item {
        padding: 12px;
    }
    
    .subtitle-result-title {
        font-size: 15px;
    }
    
    .subtitle-result-description {
        font-size: 13px;
    }
}
