/* Media Downloader Section Styles */
.downloader-section {
    padding: 20px 40px;
    animation: fadeIn 0.5s ease;
}

.downloader-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.downloader-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.downloader-source-selector {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 12px;
}

.downloader-source-selector .source-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.downloader-source-selector .source-btn.active {
    background: #8b5cf6;
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.search-container-downloader {
    position: relative;
    width: 400px;
}

.search-container-downloader input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.search-container-downloader input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #8b5cf6;
    outline: none;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.search-container-downloader button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.downloader-sub-controls {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.tv-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.selector-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selector-group label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.selector-group input {
    width: 60px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    text-align: center;
}

#getLinksBtn {
    padding: 8px 20px;
    background: #8b5cf6;
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#getLinksBtn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.downloader-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.downloader-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.downloader-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(139, 92, 246, 0.4);
}

.downloader-card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.downloader-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.downloader-card:hover .downloader-card-poster img {
    transform: scale(1.1);
}

.downloader-card-info {
    padding: 15px;
}

.downloader-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.downloader-card-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.download-link-item, .quality-item, .episode-download-item {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.link-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0; /* Allows children to shrink/wrap */
}

.file-name {
    font-weight: 600;
    color: #fff;
    word-break: break-word;
    line-height: 1.4;
}

.file-size {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.download-btn, .quality-actions button, .episode-download-item button {
    flex-shrink: 0;
    padding: 10px 24px;
    background: #8b5cf6;
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: fit-content;
    white-space: nowrap;
    min-width: 120px;
}

.download-btn:hover, .quality-actions button:hover, .episode-download-item button:hover {
    background: #7c3aed;
}

.quality-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.quality-item h4 {
    margin: 0;
    color: #a78bfa;
}

.downloader-loader {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.results-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.back-btn {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.quality-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.quality-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    width: fit-content;
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 111477 Modal Styles */
.downloader-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.downloader-modal.active {
    display: flex;
}

.downloader-modal-content {
    background: #121218;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    padding: 30px;
    position: relative;
    overflow-y: auto;
}

.downloader-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.downloader-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.modal-header-info {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.modal-poster-mini {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
}

.modal-title-area h2 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.tv-selector-pretty {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.selector-row {
    display: flex;
    gap: 15px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.fetch-btn-large {
    width: 100%;
    padding: 14px;
    background: #8b5cf6;
    border: none;
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.fetch-btn-large:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.modal-links-container {
    margin-top: 25px;
}

/* Button States */
.action-btn.ready-to-download {
    background: #10b981 !important;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
