/* Download Manager Page Styles - Extracted from templates/pages/download_manager.html */

.ldr-download-manager-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.ldr-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ldr-header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.ldr-download-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ldr-download-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Colored download button styles */
.ldr-download-buttons .btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.ldr-download-buttons .btn.btn-success {
    background: var(--success-color);
    color: white;
    border: 1px solid var(--success-color);
}

.ldr-download-buttons .btn.btn-success:hover:not(:disabled) {
    background: var(--success-color);
    border-color: var(--success-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--success-color-rgb), 0.3);
    filter: brightness(0.9);
}

.ldr-download-buttons .btn.btn-warning {
    background: var(--warning-color);
    color: var(--bg-primary);
    border: 1px solid var(--warning-color);
}

.ldr-download-buttons .btn.btn-warning:hover:not(:disabled) {
    background: var(--warning-color);
    border-color: var(--warning-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--warning-color-rgb), 0.3);
    filter: brightness(0.9);
}

.ldr-download-buttons .btn.btn-info {
    background: var(--accent-tertiary);
    color: white;
    border: 1px solid var(--accent-tertiary);
}

.ldr-download-buttons .btn.btn-info:hover:not(:disabled) {
    background: var(--accent-tertiary);
    border-color: var(--accent-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--accent-tertiary-rgb), 0.3);
    filter: brightness(0.9);
}

/* Library Settings Info Banner */
.ldr-library-settings-info {
    margin-bottom: 25px;
}

.ldr-info-banner {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: var(--card-bg, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
}

.ldr-info-banner .ldr-info-icon {
    font-size: 24px;
    color: var(--primary-color, #0d6efd);
    flex-shrink: 0;
}

.ldr-info-banner .ldr-info-content {
    flex: 1;
}

.ldr-info-banner h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #212529);
}

.ldr-info-banner p {
    margin: 8px 0;
    font-size: 14px;
}

.ldr-info-banner .ldr-warning-message {
    color: var(--warning-color);
    background: rgba(var(--warning-color-rgb), 0.15);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--warning-color);
}

.ldr-info-banner .ldr-info-message {
    color: var(--accent-tertiary);
    background: rgba(var(--accent-tertiary-rgb), 0.15);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--accent-tertiary);
}

.ldr-info-banner .ldr-settings-link {
    margin-top: 10px;
    display: inline-block;
}

.ldr-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ldr-stat-card {
    background: var(--card-bg, #2a2a2a);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color, #333);
}

.ldr-stat-card h3 {
    font-size: 32px;
    margin: 0;
    color: var(--primary-color);
}

.ldr-stat-card p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Filters Section */
.ldr-filters-section {
    background: var(--card-bg, #2a2a2a);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color, #333);
}

.ldr-filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.ldr-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.ldr-filter-group label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary, #666);
    letter-spacing: 0.5px;
}

.ldr-filter-group .form-control {
    padding: 8px 12px;
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary, #e4e4e4);
    font-size: 14px;
    transition: all 0.2s;
}

.ldr-filter-group .form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
    background: var(--bg-tertiary);
}

.ldr-filter-group select.form-control option {
    background: var(--bg-tertiary);
    color: var(--text-primary, #e4e4e4);
}

/* Date Range Group */
.ldr-filter-group.ldr-date-range {
    min-width: 280px;
}

.ldr-date-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ldr-date-inputs input {
    flex: 1;
}

.ldr-date-separator {
    color: var(--text-secondary, #666);
    font-size: 14px;
    font-weight: 500;
}

/* Search Group */
.ldr-filter-group.ldr-search-group {
    flex: 1;
    min-width: 250px;
}

.ldr-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ldr-search-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary, #999);
    font-size: 14px;
}

.ldr-search-wrapper input {
    padding-left: 36px;
    width: 100%;
}

.ldr-research-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ldr-research-item {
    background: var(--card-bg, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
}

.ldr-research-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ldr-research-item.ldr-selected {
    background: var(--card-bg, #3a3a3a);
    border-color: var(--primary-color);
}

.ldr-research-header {
    display: flex;
    align-items: start;
    gap: 20px;
}

.ldr-research-select {
    margin-top: 5px;
}

.ldr-research-info {
    flex: 1;
}

.ldr-research-info h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.ldr-research-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.ldr-research-stats {
    display: flex;
    gap: 30px;
}

.ldr-research-stats .ldr-stat {
    text-align: center;
    padding: 10px;
}

.ldr-research-stats strong {
    display: block;
    font-size: 24px;
    color: var(--text-primary);
}

.ldr-research-stats small {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.ldr-research-stats .ldr-stat.ldr-success strong {
    color: var(--success-color);
}

.ldr-research-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.ldr-research-details summary {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ldr-domain-preview {
    display: flex;
    gap: 10px;
}

.ldr-domain-chip {
    padding: 2px 8px;
    background: var(--card-bg, #2a2a2a);
    border-radius: 12px;
    font-size: 12px;
}

.ldr-sources-breakdown {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.ldr-breakdown-section h4 {
    margin: 0 0 10px;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.ldr-domain-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ldr-domain-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 13px;
}

.ldr-source-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.ldr-source-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 13px;
}

.ldr-source-item i {
    color: var(--error-color);
}

.ldr-research-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.ldr-research-actions .btn {
    background: var(--card-bg, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    color: var(--text-primary, #e4e4e4);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    white-space: nowrap;
}

.ldr-research-actions .btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.ldr-research-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Colored button variants for research actions */
.ldr-research-actions .btn.btn-success {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.ldr-research-actions .btn.btn-success:hover:not(:disabled) {
    background: var(--success-color);
    border-color: var(--success-color);
    filter: brightness(0.9);
}

.ldr-research-actions .btn.btn-warning {
    background: var(--warning-color);
    color: var(--bg-primary);
    border-color: var(--warning-color);
}

.ldr-research-actions .btn.btn-warning:hover:not(:disabled) {
    background: var(--warning-color);
    border-color: var(--warning-color);
    filter: brightness(0.9);
}

.ldr-research-actions .btn.btn-info {
    background: var(--accent-tertiary);
    color: white;
    border-color: var(--accent-tertiary);
}

.ldr-research-actions .btn.btn-info:hover:not(:disabled) {
    background: var(--accent-tertiary);
    border-color: var(--accent-tertiary);
    filter: brightness(0.9);
}

.ldr-bulk-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.ldr-bulk-actions .ldr-btn-bulk {
    background: var(--card-bg, #2a2a2a);
    border: 1px solid var(--border-color, #444);
    color: var(--text-primary, #e4e4e4);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.ldr-bulk-actions .ldr-btn-bulk:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg, #2a2a2a);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color, #333);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color, #333);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary, #e4e4e4);
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color, #333);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer .btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #333);
    background: var(--card-bg, #2a2a2a);
    color: var(--text-primary, #e4e4e4);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-footer .btn:hover {
    background: var(--primary-color);
    color: white;
}

.modal-footer .btn.btn-secondary {
    background: var(--btn-secondary-bg);
    color: white;
    border-color: var(--btn-secondary-bg);
}

.modal-footer .btn.btn-secondary:hover {
    background: var(--btn-secondary-bg);
    border-color: var(--btn-secondary-bg);
    filter: brightness(0.85);
    color: white;
}

.modal-footer .btn-danger {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.modal-footer .btn-danger:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    filter: brightness(0.85);
}

/* Progress Modal */
.ldr-overall-progress {
    margin-bottom: 25px;
}

.ldr-overall-progress p {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Succeeded/skipped/failed breakdown shown next to the "X / Y files" counter. */
.ldr-status-breakdown {
    margin-left: 6px;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.ldr-status-breakdown #skipped-count {
    color: var(--warning-color);
    font-weight: 600;
}

.ldr-status-breakdown #failed-count {
    color: var(--error-color);
    font-weight: 600;
}

.ldr-progress-bar {
    height: 35px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color, #333);
}

.ldr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--success-color));
    filter: brightness(0.95);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    position: relative;
}

.ldr-progress-fill::after {
    content: attr(data-percent);
    position: absolute;
    right: 10px;
    color: white;
    font-size: 14px;
}

.ldr-download-log {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color, #333);
}

.ldr-download-entry {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-left: 4px solid var(--border-color, #333);
    background: var(--card-bg, #2a2a2a);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-primary, #e4e4e4);
}

.ldr-download-entry.ldr-success {
    border-left-color: var(--success-color);
    background: rgba(var(--success-color-rgb), 0.1);
}

.ldr-download-entry.ldr-error {
    border-left-color: var(--error-color);
    background: rgba(var(--error-color-rgb), 0.1);
}

.ldr-download-entry.ldr-cancelled {
    border-left-color: var(--warning-color);
    background: rgba(var(--warning-color-rgb), 0.1);
}
.ldr-download-entry.ldr-skipped {
    border-left-color: var(--warning-color);
    background: rgba(var(--warning-color-rgb), 0.1);
}
.ldr-download-entry .ldr-error {
    display: block;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

/* Cancelled progress state */
.ldr-progress-fill.ldr-cancelled {
    background: var(--error-color) !important;
    filter: none;
}

/* Error text color for cancelled messages */
.ldr-error-text {
    color: var(--error-color);
}
