* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    transition: all 0.25s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: radial-gradient(circle at 20% 20%, #0f2a44 0%, #081521 40%, #050d16 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    overflow: visible !important;
    color: #fff;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background: transparent;
    min-height: 100vh;
}

.header {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 20px 40px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Breadcrumbs (migas de pan) */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.breadcrumb-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.breadcrumb-item.active {
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.breadcrumb-item.active:hover {
    background: transparent;
}

.breadcrumb-item svg {
    flex-shrink: 0;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}

@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }
    
    .header-left {
        gap: 6px;
    }
    
    .breadcrumbs {
        font-size: 0.75em;
        gap: 6px;
    }
    
    .breadcrumb-item {
        padding: 3px 6px;
        max-width: 250px;
    }
    
    .breadcrumb-item svg {
        width: 12px;
        height: 12px;
    }
}

.header h1 { 
    font-size: 1.5em; 
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.header-icons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.icon-btn.logout-btn {
    color: rgba(255, 107, 107, 0.8);
}

.icon-btn.logout-btn:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff5252;
}

.icon-btn svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.1em;
    }
    
    .icon-btn {
        padding: 6px;
    }
    
    .icon-btn svg {
        width: 20px;
        height: 20px;
    }
}

.header p { 
    display: none;
}

.content { 
    padding: 60px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .content {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 20px 15px;
    }
}

.section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

.section h2 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 1.8em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .section h2 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
}

.btn {
    background: linear-gradient(135deg, #5e72e4, #825ee4);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 700;
    letter-spacing: 0.6px;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(94, 114, 228, 0.5);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.85em;
    }
}



.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4) !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226) !important;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.6) !important;
    transform: translateY(-2px);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4) !important;
}

.btn-danger:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.chat-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .chat-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.chat-item, .file-item, .file-item-with-actions {
    background: rgba(30, 58, 95, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.chat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.1) 0%, rgba(33, 150, 243, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.chat-item:hover::before {
    opacity: 1;
}

@media (max-width: 768px) {
    .chat-item {
        padding: 15px;
    }
}

/* 🚀 EFECTO DE SELECCIÓN/HOVER UNIFICADO - Borde morado para todos */
.chat-item:hover,
.file-item:hover,
.file-item-with-actions:hover,
.stat-card:hover,
.topic-section:hover,
.tmdb-result-item:hover,
.btn:hover,
.btn-small:hover,
.pagination button:hover:not(:disabled),
.items-per-page select:hover {
    border-color: rgba(130, 94, 228, 0.8) !important;
    box-shadow: 
        0 0 25px rgba(130, 94, 228, 0.4),
        0 10px 30px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

/* Efecto específico para elementos que ya tienen transform */
.chat-item:hover,
.file-item:hover,
.file-item-with-actions:hover,
.stat-card:hover,
.topic-section:hover {
    transform: translateY(-6px) scale(1.02);
}

/* Efecto para botones */
.btn:hover,
.btn-small:hover {
    transform: translateY(-2px) scale(1.03);
}

/* Efecto para elementos TMDB */
.tmdb-result-item:hover {
    transform: translateX(5px);
}

/* Efecto para paginación */
.pagination button:hover:not(:disabled) {
    background: rgba(130, 94, 228, 0.15) !important;
}

/* Estado seleccionado para elementos TMDB */
.tmdb-result-item.selected {
    background: rgba(30, 58, 95, 0.6) !important;
    border-color: rgba(130, 94, 228, 0.8) !important;
    box-shadow: 
        0 0 25px rgba(130, 94, 228, 0.5),
        0 5px 20px rgba(0,0,0,0.4) !important;
}

.chat-item .arrow {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4em;
    transition: transform 0.3s;
    z-index: 1;
}

.chat-item:hover .arrow {
    transform: translateX(8px);
    color: #fff;
}

.chat-info {
    z-index: 1;
}

.chat-info h3 { 
    color: #fff !important; 
    margin-bottom: 8px;
    font-size: 1.05em;
    font-weight: 700 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .chat-info h3 {
        font-size: 0.95em;
    }
}

.chat-info .badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: none;
}

@media (max-width: 768px) {
    .chat-info .badge {
        font-size: 0.75em;
        padding: 3px 8px;
    }
}

.file-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* Cuando file-list solo contiene loading, centrarlo */
.file-list:has(.loading:only-child) {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.file-list:has(.file-item-with-actions) {
    grid-template-columns: 1fr;
}

@media (max-width: 1200px) {
    .file-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .file-list:has(.file-item-with-actions) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .file-list {
        grid-template-columns: 1fr;
    }
}

.file-list.with-topics {
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

@media (max-width: 1024px) {
    .file-list.with-topics {
        grid-template-columns: 1fr;
    }
}

.file-item {
    background: rgba(30, 58, 95, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.file-item:hover {
    border-color: rgba(130, 94, 228, 0.8) !important;
    box-shadow: 
        0 0 25px rgba(130, 94, 228, 0.4),
        0 10px 30px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.05) !important;
    transform: translateY(-6px) scale(1.02);
}



.file-info { 
    flex: 1; 
    min-width: 0;
}

.file-info h4 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 0.95em;
    font-weight: 700 !important;
    word-break: break-word;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.file-info h4 span:first-child {
    font-weight: 700 !important;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

.file-meta span {
    display: block;
}

.file-actions {
    display: none;
}

.file-item-with-actions {
    background: rgba(30, 58, 95, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
    cursor: pointer;
}

.file-item-with-actions:hover {
    border-color: rgba(130, 94, 228, 0.8) !important;
    box-shadow: 
        0 0 25px rgba(130, 94, 228, 0.4),
        0 10px 30px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.05) !important;
    transform: translateY(-6px) scale(1.02);
}



.file-item-with-actions .file-info {
    flex: 1;
    min-width: 0;
}

.file-item-with-actions .file-info h4 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 0.95em;
    font-weight: 700 !important;
    word-break: break-word;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 🔥 Nombre de archivo - ahora toda la tarjeta es clickable */
.file-info h4 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 0.95em;
    font-weight: 700 !important;
    word-break: break-word;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.file-item-with-actions .file-meta {
    display: flex;
    gap: 8px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

.file-actions-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .file-item {
        flex-direction: column;
        align-items: stretch;
    }
    .file-item-with-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .file-actions-buttons {
        width: 100%;
    }
    .file-actions-buttons button {
        flex: 1;
    }
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85em;
    white-space: nowrap;
    background: #5e72e4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(94, 114, 228, 0.3);
}

.btn-small:hover {
    background: #4c63d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 114, 228, 0.5);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    white-space: nowrap;
    text-align: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.12);
}

/* 🔥 Botones toggle para filtrar tipo TMDB - Mismo estilo que btn-secondary */
.tmdb-type-toggle {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.type-btn {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: none;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Efecto espejo/brillo */
.type-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
    z-index: 1;
    pointer-events: none;
}

.type-btn:hover::before {
    left: 100%;
}

.type-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(130, 94, 228, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(130, 94, 228, 0.3);
    color: #fff;
}

.type-btn.active {
    background: rgba(30, 58, 95, 0.6);
    border-color: rgba(130, 94, 228, 0.5);
    color: #fff;
    box-shadow: 
        0 0 15px rgba(130, 94, 228, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Asegurar que el texto esté por encima del efecto */
.type-btn > * {
    position: relative;
    z-index: 2;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1em;
}

/* 🔥 Ocultar textos de loading, solo mostrar spinner */
.loading p {
    display: none;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #5e72e4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0;
    box-shadow: 0 0 15px rgba(94, 114, 228, 0.4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.back-btn {
    background: transparent;
    color: #fff;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.success-msg {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    font-weight: 500;
}

.error-msg {
    background: rgba(244, 67, 54, 0.15);
    color: #ef5350;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid rgba(244, 67, 54, 0.3);
    font-weight: 500;
}

.success-msg {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #c8e6c9;
}

.error-msg {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #ffcdd2;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .stats {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
}

.stat-card {
    background: rgba(30, 58, 95, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 30px 24px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.3s;
}



@media (max-width: 768px) {
    .stat-card {
        padding: 20px 15px;
    }
}

.stat-card h3 {
    font-weight: 700;
    font-size: 2.5em;
    color: #fff;
    margin-bottom: 8px;
}

.stat-card p { 
    color: rgba(255, 255, 255, 0.6); 
    font-weight: 500;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topic-section {
    background: #1e3a5f;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}



.topic-header {
    background: transparent;
    color: #fff;
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.3s;
    border: none;
}

.topic-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.topic-header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.topic-title {
    color: #fff !important;
    font-size: 1.05em;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.topic-count {
    color: rgba(255, 255, 255, 0.6) !important;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.85em;
    font-weight: 400;
}

.topic-toggle {
    font-size: 1.4em;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
}

.topic-toggle.collapsed {
    transform: rotate(-90deg);
}

.topic-content {
    padding: 20px;
    display: grid;
    gap: 15px;
    max-height: 2000px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.15);
    display: none;
}

.topic-content.collapsed {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

.topic-content .file-item {
    background: #1e3a5f;
    border: 1px solid rgba(255, 255, 255, 0.12);
}


/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination button {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s;
    min-width: 40px;
}



.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination button.active {
    background: #5e72e4;
    color: white;
    border-color: #5e72e4;
    box-shadow: 0 2px 8px rgba(94, 114, 228, 0.4);
}

.pagination .page-info {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .pagination {
        gap: 5px;
        margin: 20px 0;
    }
    
    .pagination button {
        padding: 6px 12px;
        font-size: 0.85em;
        min-width: 35px;
    }
    
    .pagination .page-info {
        font-size: 0.85em;
        padding: 0 5px;
    }
}

/* Selector de items por página */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    gap: 15px;
    flex-wrap: wrap;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

.items-per-page select {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.9em;
    background: #1e3a5f;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}



.items-per-page select option {
    background: #1e3a5f;
    color: #fff;
}

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .items-per-page {
        justify-content: center;
    }
}


/* Campo de búsqueda simple */
.search-input {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    background: #1e3a5f;
    color: #fff;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    border-color: #5e72e4;
    background: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2);
}

@media (max-width: 768px) {
    .search-input {
        padding: 10px 12px;
        font-size: 16px;
    }
}

/* Título principal más grande */
#main-view h2 {
    font-size: 2em;
    font-weight: 700 !important;
    color: #fff !important;
    margin-bottom: 25px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    #main-view h2 {
        font-size: 1.5em;
    }
}


/* Efectos adicionales y mejoras visuales */
.content-type-selector {
    display: none;
}

/* Animación de entrada para las tarjetas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-item, .file-item, .stat-card, .topic-section {
    animation: fadeInUp 0.5s ease-out;
}

/* Efecto de brillo en hover para botones principales */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn:hover::before {
    left: 100%;
}

/* 🚀 EFECTO DE BRILLO EXTENDIDO - Para todos los elementos interactivos */
.chat-item::before,
.file-item::before,
.file-item-with-actions::before,
.stat-card::before,
.topic-section::before,
.tmdb-result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.chat-item,
.file-item,
.file-item-with-actions,
.stat-card,
.topic-section,
.tmdb-result-item {
    position: relative;
    overflow: hidden;
}

.chat-item:hover::before,
.file-item:hover::before,
.file-item-with-actions:hover::before,
.stat-card:hover::before,
.topic-section:hover::before,
.tmdb-result-item:hover::before {
    left: 100%;
}

/* Asegurar que el contenido esté por encima del efecto */
.chat-item > *,
.file-item > *,
.file-item-with-actions > *,
.stat-card > *,
.topic-section > *,
.tmdb-result-item > * {
    position: relative;
    z-index: 2;
}

/* Botones de filtro específicos */
#filter-series, #filter-movies {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

#filter-series:hover, #filter-movies:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: none !important;
    scale: none !important;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(94, 114, 228, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(94, 114, 228, 0.8);
}

/* Mejora para dispositivos móviles */
@media (max-width: 768px) {
    body {
        background: #0a1929;
    }
    
    .header h1 {
        font-size: 1.2em;
    }
    
    .section h2 {
        font-size: 1.5em;
    }
}

/* Efecto de partículas de fondo (sutil) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(66, 165, 245, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(33, 150, 243, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Mejora del selector de contenido */
select#content-type {
    display: none;
}

/* Estilo para inputs ocultos */
input[type="hidden"] {
    display: none;
}

/* Mejora de accesibilidad y focus */
button:focus,
input:focus,
select:focus {
    outline: 2px solid rgba(94, 114, 228, 0.6);
    outline-offset: 2px;
}

/* Animación del spinner mejorada */
@keyframes spin {
    0% { 
        transform: rotate(0deg);
    }
    100% { 
        transform: rotate(360deg);
    }
}

/* Efecto de pulso para elementos importantes */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}

/* 🚀 EFECTOS PREMIUM PERMANENTES EN MÓVIL */
@media (hover: none) {
    /* Cards y elementos interactivos siempre con efecto premium */
    .chat-item,
    .file-item,
    .file-item-with-actions,
    .stat-card,
    .topic-section,
    .tmdb-result-item {
        transform: translateY(-3px);
        box-shadow: 
            0 0 20px rgba(130, 94, 228, 0.25),
            0 5px 15px rgba(0,0,0,0.4),
            inset 0 1px 0 rgba(255,255,255,0.05);
        border-color: rgba(130, 94, 228, 0.3) !important;
    }

    /* Botones con efecto premium permanente */
    .btn,
    .btn-small,
    .btn-secondary {
        transform: translateY(-2px);
        box-shadow: 
            0 0 15px rgba(130, 94, 228, 0.2),
            0 4px 12px rgba(0,0,0,0.3);
        border-color: rgba(130, 94, 228, 0.25) !important;
    }

    /* Efecto de brillo permanente más sutil */
    .chat-item::before,
    .file-item::before,
    .file-item-with-actions::before,
    .stat-card::before,
    .topic-section::before,
    .tmdb-result-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
        pointer-events: none;
        z-index: 1;
    }

    /* Asegurar que el contenido esté por encima */
    .chat-item,
    .file-item,
    .file-item-with-actions,
    .stat-card,
    .topic-section,
    .tmdb-result-item {
        position: relative;
    }

    .chat-item > *,
    .file-item > *,
    .file-item-with-actions > *,
    .stat-card > *,
    .topic-section > *,
    .tmdb-result-item > * {
        position: relative;
        z-index: 2;
    }

    /* Efecto :active más intenso para feedback táctil */
    .chat-item:active,
    .file-item:active,
    .file-item-with-actions:active,
    .stat-card:active,
    .topic-section:active,
    .tmdb-result-item:active {
        transform: translateY(-6px) scale(1.02);
        box-shadow: 
            0 0 30px rgba(130, 94, 228, 0.5),
            0 10px 25px rgba(0,0,0,0.6),
            inset 0 2px 0 rgba(255,255,255,0.1);
        border-color: rgba(130, 94, 228, 0.6) !important;
    }

    .btn:active,
    .btn-small:active,
    .btn-secondary:active {
        transform: translateY(-4px) scale(1.03);
        box-shadow: 
            0 0 25px rgba(130, 94, 228, 0.4),
            0 8px 20px rgba(0,0,0,0.5);
    }

    /* Paginación también con efecto premium */
    .pagination button {
        transform: translateY(-1px);
        box-shadow: 0 0 10px rgba(130, 94, 228, 0.15);
        border-color: rgba(130, 94, 228, 0.2) !important;
    }

    .pagination button:active {
        transform: translateY(-3px);
        box-shadow: 0 0 20px rgba(130, 94, 228, 0.3);
    }
}


/* Modal de Renombrado TMDB */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden !important;
}

/* 🔥 SOLUCIÓN DEFINITIVA - Modal completamente fuera del flujo */
#settings-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
}

/* ✅ MODAL LIMPIO Y NATURAL - Sin grid, layout vertical */
#rename-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 999999 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    overflow: hidden !important;
}

.modal-content {
    background: rgba(30, 58, 95, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    max-width: 800px;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.8),
        inset 0 1px 0 rgba(255,255,255,0.1);
    display: flex !important;
    flex-direction: column;
}

/* 🔥 SOLUCIÓN DEFINITIVA - Contenido forzado al centro */
#settings-modal .modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1000000 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s ease !important;
}

/* 🔥 SOLUCIÓN DEFINITIVA - Contenido del modal de renombrado */
#rename-modal .modal-content {
    background: rgba(30, 58, 95, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(130, 94, 228, 0.6) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    box-shadow: 
        0 0 25px rgba(130, 94, 228, 0.4),
        0 10px 30px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.05) !important;
    z-index: 1000001 !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
}

/* 🎨 HOVER DESKTOP - Borde morado más intenso */
@media (hover: hover) {
    #rename-modal .modal-content:hover {
        border-color: rgba(130, 94, 228, 0.9) !important;
        box-shadow: 
            0 0 30px rgba(130, 94, 228, 0.6),
            0 10px 30px rgba(0,0,0,0.6),
            inset 0 1px 0 rgba(255,255,255,0.05) !important;
    }
}

/* 🔥 Evitar desbordamiento en elementos internos del modal */
#rename-modal .form-group input,
#rename-modal .tmdb-results,
#rename-modal .preview-box,
#rename-modal #rename-results {
    max-width: 100% !important;
    overflow-x: hidden !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
}

#rename-modal .tmdb-result-item {
    max-width: 100% !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
}

/* Hover effect solo en desktop */
@media (hover: hover) {
    #settings-modal .modal-content:hover {
        border-color: rgba(130, 94, 228, 0.6) !important;
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(130, 94, 228, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    }
}

/* Borde morado permanente en móvil */
@media (hover: none) {
    #settings-modal .modal-content {
        border-color: rgba(130, 94, 228, 0.6) !important;
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(130, 94, 228, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 20px 25px;
    flex: 0 1 auto;
    overflow: visible;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(130, 94, 228, 0.8);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 0 3px rgba(130, 94, 228, 0.2),
        0 0 15px rgba(130, 94, 228, 0.3);
}

.form-group input[readonly] {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.6);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
}

.tmdb-results {
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px;
}

.tmdb-result-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    gap: 12px;
    align-items: center;
}



.tmdb-result-item.selected {
    background: rgba(94, 114, 228, 0.2);
    border-color: #5e72e4;
}

.tmdb-result-poster {
    width: 50px;
    height: 75px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.tmdb-result-info {
    flex: 1;
}

.tmdb-result-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.tmdb-result-meta {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

.preview-box {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.preview-box h3 {
    margin: 0 0 12px 0;
    font-size: 1em;
    color: #fff;
}

.preview-item {
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 6px;
    font-size: 0.85em;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-item strong {
    color: rgba(255, 255, 255, 0.7);
    display: inline-block;
    min-width: 80px;
}

.preview-item span {
    color: #fff;
}

.modal-body .loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.modal-body .loading .spinner {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid #5e72e4;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}

@media (max-width: 768px) {
    .modal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }
    
    .modal-content {
        max-width: 100% !important;
        max-height: 100vh !important;
        height: 100vh !important;
        width: 100% !important;
        margin: 0;
        border-radius: 0;
        display: flex !important;
        flex-direction: column;
        background: rgba(30, 58, 95, 0.98) !important;
        border: none !important;
    }
    
    /* 🚀 OPTIMIZACIÓN MÓVIL - MEJOR USO DE PANTALLA */
    .header {
        padding: 12px 15px;
        min-height: auto;
    }
    
    .content {
        padding: 15px 10px;
        max-width: 100%;
    }
    
    /* Reducir espaciado en móvil para aprovechar más pantalla */
    .section h2 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }
    
    .stats {
        margin: 15px 0;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px 12px;
    }
    
    .stat-card h3 {
        font-size: 2em;
        margin-bottom: 5px;
    }
    
    .stat-card p {
        font-size: 0.8em;
    }
    
    /* Botones más compactos pero táctiles */
    .btn {
        padding: 12px 20px;
        font-size: 0.9em;
        margin: 5px 0;
    }
    
    .btn-small {
        padding: 10px 16px;
        font-size: 0.85em;
    }
    
    /* File list más compacto */
    .file-item,
    .file-item-with-actions {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .file-info h4 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    .file-meta {
        font-size: 0.8em;
    }
    
    /* Chat items más compactos */
    .chat-item {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .chat-info h3 {
        font-size: 0.95em;
        margin-bottom: 6px;
    }
    
    /* Topic sections más compactos */
    .topic-section {
        margin-bottom: 10px;
    }
    
    .topic-header {
        padding: 15px;
    }
    
    .topic-title {
        font-size: 0.95em;
    }
    
    .topic-count {
        font-size: 0.8em;
    }
    
    /* Paginación más compacta */
    .pagination {
        margin: 15px 0;
        gap: 5px;
    }
    
    .pagination button {
        padding: 8px 12px;
        font-size: 0.8em;
        min-width: 32px;
    }
    
    .pagination-controls {
        margin: 15px 0;
        gap: 10px;
    }
    
    /* Search input más compacto */
    .search-input {
        padding: 12px 15px;
        font-size: 0.9em;
        margin-bottom: 15px;
    }
    
    /* Loading spinner optimizado para móvil */
    .loading {
        padding: 30px 15px;
        font-size: 0.9em;
    }
    
    .spinner {
        width: 35px;
        height: 35px;
        margin: 15px auto;
    }
    
    /* 🚀 OPTIMIZACIÓN ESPECÍFICA PARA CONTROLES DE ARCHIVOS */
    div[style*="display: flex; justify-content: space-between"] {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: stretch !important;
        margin: 20px 0 15px 0 !important;
    }
    
    /* Botones de acción principales */
    div[style*="display: flex; justify-content: space-between"] > div:first-child {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    div[style*="display: flex; justify-content: space-between"] > div:first-child button {
        width: 100% !important;
        margin: 0 !important;
        padding: 14px 20px !important;
        font-size: 0.9em !important;
        font-weight: 600 !important;
    }
    
    /* Botones de filtro */
    div[style*="display: flex; justify-content: space-between"] > div:last-child {
        display: flex !important;
        gap: 10px !important;
        justify-content: center !important;
    }
    
    div[style*="display: flex; justify-content: space-between"] > div:last-child button {
        flex: 1 !important;
        margin: 0 !important;
        padding: 12px 16px !important;
        font-size: 0.85em !important;
        font-weight: 600 !important;
        text-align: center !important;
    }
    
    /* 🚀 MEJORA PARA BACK BUTTON */
    .back-btn {
        width: 100% !important;
        margin-bottom: 15px !important;
        padding: 12px 20px !important;
        font-size: 0.9em !important;
        font-weight: 600 !important;
        text-align: center !important;
    }
    
    /* 🚀 OPTIMIZACIÓN PARA MENSAJES */
    #message {
        margin: 15px 0 !important;
    }
    
    #message .success-msg,
    #message .error-msg {
        padding: 12px 15px !important;
        font-size: 0.9em !important;
        border-radius: 8px !important;
    }
    
    /* 🚀 OPTIMIZACIÓN PARA FILE LIST GRID */
    .file-list {
        gap: 12px !important;
        margin-top: 15px !important;
    }
    
    .file-list.with-topics {
        gap: 12px !important;
    }
    
    .modal-header {
        padding: 15px;
        flex-shrink: 0;
        border-radius: 0;
    }
    
    .modal-body {
        padding: 15px;
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-header h2 {
        font-size: 1.3em;
        margin: 0;
    }
    
    .form-group {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .form-group label {
        font-size: 0.9em;
        margin-bottom: 6px;
        font-weight: 600;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 0.95em;
    }
    
    /* 🚀 EFECTOS TÁCTILES PARA INPUTS EN MÓVIL */
    .form-group input:focus,
    .form-group select:focus {
        border-color: rgba(130, 94, 228, 0.8) !important;
        box-shadow: 
            0 0 0 3px rgba(130, 94, 228, 0.2),
            0 0 15px rgba(130, 94, 228, 0.3) !important;
        transform: scale(1.02);
    }
    
    .tmdb-results {
        max-height: 180px;
        margin: 0;
        padding: 10px;
        flex-shrink: 0;
    }
    
    .tmdb-result-item {
        padding: 12px;
        margin-bottom: 8px;
        flex-direction: row;
        text-align: left;
        gap: 12px;
        align-items: center;
        position: relative;
        overflow: hidden;
    }
    
    /* 🚀 EFECTOS TÁCTILES PARA RESULTADOS TMDB EN MÓVIL */
    .tmdb-result-item:active {
        border-color: rgba(130, 94, 228, 0.8) !important;
        box-shadow: 
            0 0 25px rgba(130, 94, 228, 0.4),
            0 10px 30px rgba(0,0,0,0.6),
            inset 0 1px 0 rgba(255,255,255,0.05) !important;
        transform: scale(1.02);
    }
    
    /* 🚀 EFECTO ESPEJO PARA MÓVIL - ACTIVADO CON TOUCH */
    .tmdb-result-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.6s ease;
        z-index: 1;
        pointer-events: none;
    }
    
    .tmdb-result-item:active::before {
        left: 100%;
    }
    
    /* Asegurar que el contenido esté por encima del efecto */
    .tmdb-result-item > * {
        position: relative;
        z-index: 2;
    }
    
    .tmdb-result-poster {
        width: 45px;
        height: 65px;
        flex-shrink: 0;
    }
    
    .tmdb-result-info {
        text-align: left;
        flex: 1;
    }
    
    .tmdb-result-title {
        font-size: 0.95em;
        margin-bottom: 4px;
        font-weight: 600;
    }
    
    .tmdb-result-meta {
        font-size: 0.8em;
        line-height: 1.3;
    }
    
    .preview-box {
        padding: 12px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .preview-box h3 {
        font-size: 1em;
        margin-bottom: 8px;
        font-weight: 600;
    }
    
    .preview-item {
        padding: 8px;
        font-size: 0.85em;
        margin-bottom: 6px;
    }
    
    .preview-item strong {
        display: inline-block;
        margin-right: 8px;
        min-width: 70px;
        font-weight: 600;
    }
    
    /* 🚀 BOTONES CON EFECTOS TÁCTILES EN MÓVIL */
    .modal-body > div:last-child {
        flex-direction: column;
        gap: 10px !important;
        margin-top: auto !important;
        padding-top: 15px;
        flex-shrink: 0;
    }
    
    .modal-body > div:last-child button {
        width: 100%;
        padding: 15px;
        font-size: 0.9em;
        font-weight: 600;
        border-radius: 8px;
        position: relative;
        overflow: hidden;
    }
    
    /* 🚀 EFECTOS TÁCTILES PARA BOTONES */
    .modal-body > div:last-child button:active {
        border-color: rgba(130, 94, 228, 0.8) !important;
        box-shadow: 
            0 0 25px rgba(130, 94, 228, 0.4),
            0 5px 20px rgba(0,0,0,0.4) !important;
        transform: scale(0.98);
    }
    
    /* 🚀 EFECTO ESPEJO PARA BOTONES EN MÓVIL */
    .modal-body > div:last-child button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s ease;
        z-index: 1;
        pointer-events: none;
    }
    
    .modal-body > div:last-child button:active::before {
        left: 100%;
    }
    
    /* Asegurar que el texto del botón esté por encima */
    .modal-body > div:last-child button > * {
        position: relative;
        z-index: 2;
    }
    
    /* Input + botón en móvil */
    .form-group > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .form-group > div[style*="display: flex"] button {
        width: 100%;
        padding: 12px;
        font-size: 0.9em;
        position: relative;
        overflow: hidden;
    }
    
    /* 🚀 EFECTOS TÁCTILES PARA BOTÓN DE BÚSQUEDA */
    .form-group > div[style*="display: flex"] button:active {
        border-color: rgba(130, 94, 228, 0.8) !important;
        box-shadow: 
            0 0 20px rgba(130, 94, 228, 0.3),
            0 5px 15px rgba(0,0,0,0.3) !important;
        transform: scale(0.98);
    }
    
    /* 🚀 EFECTO ESPEJO PARA BOTÓN DE BÚSQUEDA */
    .form-group > div[style*="display: flex"] button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s ease;
        z-index: 1;
        pointer-events: none;
    }
    
    .form-group > div[style*="display: flex"] button:active::before {
        left: 100%;
    }
    
    /* Texto informativo más visible */
    .modal-body > div[style*="margin-top: 8px"] {
        margin-top: 0 !important;
        padding: 10px !important;
        font-size: 0.85em !important;
        border-radius: 6px;
        flex-shrink: 0;
    }
}
/* 🔥 EXTRA MÓVIL - Modal de renombrado pantalla completa */
@media (max-width: 768px) {
    #rename-modal .modal-content {
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        padding: 15px !important;
    }
}
/* 🔥 HACER MODAL MÁS COMPACTO */
#rename-modal .modal-content {
    padding: 15px !important;
    max-width: 1400px !important;
    width: 95% !important;
    max-height: 98vh !important;
}

#rename-modal .modal-header h2 {
    font-size: 1.5em !important;
    margin: 0 !important;
}

#rename-modal .modal-body {
    max-height: calc(85vh - 100px) !important;
    font-size: 1em !important;
}

#rename-modal .form-group {
    margin-bottom: 12px !important;
}

#rename-modal .form-group label {
    font-size: 0.95em !important;
    margin-bottom: 5px !important;
}

#rename-modal .form-group input,
#rename-modal .form-group select {
    padding: 8px 12px !important;
    font-size: 0.95em !important;
}

#rename-modal .tmdb-results {
    max-height: 180px !important;
    margin: 10px 0 !important;
}

#rename-modal .tmdb-result-item {
    padding: 10px !important;
    margin-bottom: 6px !important;
    font-size: 0.9em !important;
}

#rename-modal .tmdb-result-title {
    font-size: 1em !important;
    margin-bottom: 3px !important;
}

#rename-modal .tmdb-result-meta {
    font-size: 0.85em !important;
}

#rename-modal .preview-box {
    padding: 12px !important;
    margin: 10px 0 !important;
    font-size: 0.9em !important;
}

#rename-modal .preview-box h3 {
    font-size: 1em !important;
    margin-bottom: 8px !important;
}

#rename-modal #rename-results {
    max-height: 120px !important;
    font-size: 0.9em !important;
}

#rename-modal .btn {
    padding: 10px 16px !important;
    font-size: 0.9em !important;
}

#rename-modal .modal-close {
    width: 35px !important;
    height: 35px !important;
    font-size: 1.5em !important;
}


/* 🚀 OPTIMIZACIÓN MÓVIL PARA MODAL RENAME - SOLUCIÓN EXACTA */
@media (max-width: 768px) {
    /* 🔥 RESULTADOS más pequeños */
    #tmdb-results {
        max-height: 180px;
        overflow-y: auto;
    }
    
    /* 🔥 OCULTAR TODAS LAS DESCRIPCIONES */
    .tmdb-result-item p {
        display: none !important;
    }
    
    /* 🔥 solo dejamos el primero (año + rating) */
    .tmdb-result-item p:first-of-type {
        display: block !important;
        font-size: 11px;
        margin: 0;
        line-height: 1.3;
    }
    
    /* 🔥 CARD estilo lista horizontal */
    .tmdb-result-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        padding: 10px;
        gap: 10px;
        border-radius: 8px;
    }
    
    /* 🔥 imagen más pequeña */
    .tmdb-result-item img,
    .tmdb-result-poster {
        width: 60px !important;
        height: 90px !important;
        object-fit: cover;
        border-radius: 6px;
        flex-shrink: 0;
    }
    
    /* 🔥 título compacto */
    .tmdb-result-item h4,
    .tmdb-result-title {
        font-size: 13px !important;
        margin: 0 !important;
        line-height: 1.3;
    }
    
    /* 🔥 Contenedor de info */
    .tmdb-result-info {
        flex: 1;
        min-width: 0;
    }
}



/* ✅ ARREGLO DEFINITIVO MÓVIL */
@media (max-width: 768px) {
    /* 🔥 El modal ocupa toda la pantalla CON BORDES REDONDEADOS */
    #rename-modal .modal-content {
        height: 100dvh;
        max-height: 100dvh;
        display: flex;
        flex-direction: column;
        border-radius: 16px !important;
    }
    
    /* 🔥 SOLO el modal scrollea */
    #rename-modal {
        overflow-y: auto;
    }
    
    /* ✅ PERMITIR scroll REAL en el body */
    #rename-modal .modal-body {
        overflow-y: auto !important;
        flex: 1;
        padding-bottom: 20px;
    }
    
    /* 🔥 Ajustes visuales */
    #rename-modal .modal-body {
        padding: 16px;
        gap: 12px;
        display: flex;
        flex-direction: column;
    }
    
    #rename-modal .modal-header {
        padding: 16px;
        flex-shrink: 0;
    }
    
    /* 🔥 Botón BUSCAR debajo y full width */
    #rename-modal .input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    #rename-modal .input-group button {
        width: 100%;
    }
    
    /* 🔥 RESULTADOS TMDB lista horizontal */
    .tmdb-result-item {
        display: flex !important;
        gap: 12px;
        align-items: center;
        padding: 12px;
        flex-direction: row !important;
        text-align: left !important;
    }
    
    .tmdb-result-item img,
    .tmdb-result-poster {
        width: 60px !important;
        height: 90px !important;
        object-fit: cover;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .tmdb-result-info {
        flex: 1;
        overflow: hidden;
    }
    
    .tmdb-result-item h4,
    .tmdb-result-title {
        font-size: 14px !important;
        margin: 0 0 4px 0 !important;
    }
    
    .tmdb-result-item p,
    .tmdb-result-meta {
        font-size: 12px !important;
        opacity: 0.8;
        margin: 0 !important;
    }
    
    /* 🔥 Ocultar descripción larga */
    .tmdb-result-item p:not(:first-of-type) {
        display: none !important;
    }
    
    /* 🔥 PREVIEW compacto */
    .preview-box {
        padding: 10px;
    }
    
    /* 🔥 BOTONES abajo en columna - PARTE DEL FLUJO */
    .modal-actions {
        flex-direction: column;
        gap: 10px;
        flex-shrink: 0;
    }
    
    .modal-actions button {
        width: 100%;
    }
}


/* 🔥 FIX BOTONES MÓVIL - AJUSTE FINAL */
@media (max-width: 768px) {
    /* Reducir espacio del header */
    #rename-modal .modal-header {
        padding: 8px 12px !important;
        flex-shrink: 0;
    }
    
    /* Reducir padding del body - SIN espacio extra para botones fijos */
    #rename-modal .modal-body {
        padding: 10px 12px !important;
    }
    
    /* Reducir espacio entre form-groups */
    #rename-modal .form-group {
        margin-bottom: 8px !important;
    }
    
    /* El div que contiene los botones - PARTE DEL LAYOUT (NO fixed) */
    #rename-modal .modal-body > div[style*="display: flex"]:last-child {
        flex-shrink: 0;
        margin: 0 !important;
        padding: 12px 0 !important;
        gap: 8px !important;
    }
    
    #rename-modal .modal-body > div[style*="display: flex"]:last-child button {
        flex: 1 !important;
        padding: 12px 8px !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        text-align: center !important;
        height: auto !important;
        min-height: 44px !important;
    }
}


/* 🔥 OCULTAR SCROLLBAR EN MODAL */
#rename-modal::-webkit-scrollbar,
#rename-modal .modal-body::-webkit-scrollbar,
#tmdb-results::-webkit-scrollbar {
    display: none !important;
}

#rename-modal,
#rename-modal .modal-body,
#tmdb-results {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}


/* 🔥 FIX REAL PARA TU CASO */
#rename-modal .modal-content {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

/* el body ocupa el espacio y scrollea */
#rename-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px; /* 🔥 espacio para los botones */
}

/* los botones se quedan abajo pero SIN fixed */
#rename-modal .modal-footer-buttons {
    flex-shrink: 0;
    padding: 10px;
    background: inherit;
}


@media (max-width: 768px) {
    #rename-modal {
        display: flex;
        height: 100dvh;
        padding: 0 !important;
    }
    
    #rename-modal .modal-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
    }
    
    /* 🔥 ESTA ES LA CLAVE REAL */
    #rename-modal .modal-body {
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    /* opcional pero recomendado */
    #rename-modal .modal-body > * {
        width: 100%;
    }
    
    #rename-modal .modal-footer-buttons {
        flex-shrink: 0;
    }
}


@media (max-width: 768px) {
    #rename-modal {
        padding: 0;
    }
    
    #rename-modal .modal-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100dvh;
        max-width: none;
        margin: 0;
        border-radius: 0;
    }
    
    #rename-modal .modal-body {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 20px;
    }
    
    #rename-modal .modal-footer-buttons {
        flex-shrink: 0;
        padding: 10px;
    }
}


/* 🔥 AJUSTE DE BOTONES PARA MÓVIL - APILADOS VERTICALMENTE */
@media (max-width: 768px) {
    /* Contenedor de botones en móvil */
    #rename-modal .modal-content > div[style*="display: flex; gap: 15px"] {
        flex-direction: column !important;
        padding: 12px 12px !important;
        gap: 8px !important;
    }
    
    /* Botones en móvil - ocupan todo el ancho */
    #rename-modal .modal-content > div[style*="display: flex; gap: 15px"] .btn {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 0.85em !important;
    }
}

/* ============================================================
   🔍 DETECCIÓN DE DUPLICADOS
   ============================================================ */

/* Resaltado en lista de archivos */
.dup-highlight {
    border: 1px solid rgba(255, 180, 0, 0.6) !important;
    background: rgba(255, 160, 0, 0.08) !important;
    position: relative;
}
.dup-highlight::before {
    content: '⚠️ Duplicado';
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 0.7em;
    color: #ffd966;
    background: rgba(255, 160, 0, 0.15);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 180, 0, 0.3);
    pointer-events: none;
    z-index: 2;
}

/* Modal duplicados */
#duplicates-modal .dup-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.9em;
}
#duplicates-modal .dup-summary--warn {
    background: rgba(255, 160, 0, 0.12);
    border: 1px solid rgba(255, 180, 0, 0.35);
    color: #ffd966;
}
#duplicates-modal .dup-summary--ok {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.35);
    color: #81c784;
}
#duplicates-modal .dup-dir {
    font-size: 0.8em;
    color: rgba(255,255,255,0.5);
    word-break: break-all;
}
#duplicates-modal .dup-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#duplicates-modal .dup-row {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,180,0,0.2);
    border-radius: 8px;
    padding: 10px 14px;
}
#duplicates-modal .dup-filename {
    font-size: 0.88em;
    color: #fff;
    margin-bottom: 6px;
    word-break: break-all;
}
#duplicates-modal .dup-existing {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
#duplicates-modal .dup-path {
    font-size: 0.78em;
    color: rgba(255,255,255,0.45);
    word-break: break-all;
}
#duplicates-modal .dup-empty {
    text-align: center;
    padding: 30px 20px;
    color: #81c784;
    font-size: 0.95em;
}

/* ============================================================
   🔎 BUSCADOR DE ARCHIVOS EN LISTA
   ============================================================ */
.file-search-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0 14px;
    margin-bottom: 14px;
    transition: border-color 0.2s, background 0.2s;
    gap: 8px;
}
.file-search-bar:focus-within {
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.08);
}
.file-search-icon {
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.file-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.9em;
    padding: 11px 0;
    -webkit-appearance: none;
}
.file-search-input:focus {
    outline: none !important;
    box-shadow: none !important;
}
.file-search-input::placeholder { color: rgba(255,255,255,0.35); }
.file-search-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.file-search-clear:hover { color: #fff; }
.file-search-count {
    font-size: 0.8em;
    color: rgba(255,255,255,0.45);
    margin: -8px 0 10px 4px;
}

/* ── Duplicados modal mejorado ───────────────────────────────────── */
.dup-modal-content {
    max-width: 680px;
    border-radius: 16px !important;
}
.dup-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 20px 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dup-modal-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
/* ── Modal duplicados ─────────────────────────────────────── */
.dup-modal-content {
    max-width: 680px;
    border-radius: 18px !important;
}
.dup-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 20px 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.dup-modal-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.dup-modal-icon {
    flex-shrink: 0;
    width: 30px; height: 30px;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.22);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #f5a623;
    margin-top: 2px;
}
.dup-modal-title h2 {
    margin: 0;
    font-size: 1.05em;
    color: #fff;
}
.dup-modal-subtitle {
    margin: 3px 0 0;
    font-size: 0.76em;
    color: rgba(255,255,255,0.4);
    word-break: break-all;
}
.dup-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Lista ───────────────────────────────────────────────── */
.dup-list2 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 2px;
}
.dup-list2::-webkit-scrollbar { width: 4px; }
.dup-list2::-webkit-scrollbar-track { background: transparent; }
.dup-list2::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ── Tarjeta de duplicado ────────────────────────────────── */
.dup-row2 {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 14px;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.dup-row2:hover {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    transform: translateY(-1px);
}
.dup-row2-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.dup-row2-icon {
    flex-shrink: 0;
    width: 28px; height: 28px;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.22);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
    font-size: 0;
}
.dup-row2-icon::after {
    content: '';
    width: 8px; height: 8px;
    background: #f5a623;
    border-radius: 50%;
    display: block;
}
.dup-row2-info {
    flex: 1;
    min-width: 0;
}
.dup-row2-name {
    font-size: 0.82em;
    font-weight: 600;
    color: #e8ecf2;
    word-break: break-all;
    margin-bottom: 6px;
    font-family: 'Courier New', monospace;
}
.dup-row2-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* ── Copias dentro de tarjeta ────────────────────────────── */
.dup-row2-siblings {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 0 10px 38px;
}
.dup-sibling {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 7px;
    font-size: 0.74em;
    color: rgba(255,255,255,0.45);
    word-break: break-all;
    font-family: 'Courier New', monospace;
}
.dup-sibling-icon {
    flex-shrink: 0;
    opacity: 0.5;
    display: flex; align-items: center;
}

/* ── Acciones ────────────────────────────────────────────── */
.dup-row2-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: flex-end;
}
.dup-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    background: rgba(232, 71, 42, 0.08);
    border: 1.5px solid rgba(232, 71, 42, 0.28);
    color: #e8593a;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.12s;
    font-family: inherit;
}
.dup-delete-btn:hover {
    background: rgba(232, 71, 42, 0.16);
    border-color: rgba(232, 71, 42, 0.5);
    transform: translateY(-1px);
}
.dup-delete-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}
@keyframes dup-spin { to { transform: rotate(360deg); } }
.dup-deleting-spinner {
    display: inline-block;
    width: 11px; height: 11px;
    border: 2px solid rgba(232, 89, 58, 0.3);
    border-top-color: #e8593a;
    border-radius: 50%;
    animation: dup-spin 0.7s linear infinite;
}

/* ── Tags ────────────────────────────────────────────────── */
.dup-tags { display: inline-flex; gap: 5px; margin-left: 6px; vertical-align: middle; }
.dup-tag {
    font-size: 0.67em;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 100px;
    white-space: nowrap;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.dup-tag--internal {
    background: rgba(232, 71, 42, 0.1);
    border: 1px solid rgba(232, 71, 42, 0.28);
    color: #e8593a;
}
.dup-tag--disk {
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.26);
    color: #f5a623;
}
.dup-summary-detail {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: -6px 0 12px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🔥 OPTIMIZACIÓN MÓVIL PARA DUPLICADOS - SOLUCIÓN COMPLETA
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    
    /* ── Lista de duplicados ────────────────────────────────── */
    .dup-list2 {
        max-height: 60vh; /* Reducir altura máxima en móvil */
        gap: 8px; /* Reducir espacio entre elementos */
        padding-right: 0; /* Eliminar padding derecho */
        margin: 0 -10px; /* Expandir a los bordes del contenedor */
        padding: 0 10px; /* Agregar padding interno */
    }
    
    /* ── Tarjeta de duplicado ────────────────────────────────── */
    .dup-row2 {
        padding: 12px; /* Reducir padding */
        border-radius: 10px; /* Bordes más pequeños */
        margin-bottom: 0; /* Eliminar margen inferior */
    }
    
    .dup-row2:hover {
        transform: none; /* Eliminar efecto hover en móvil */
    }
    
    /* ── Header de la tarjeta ────────────────────────────────── */
    .dup-row2-header {
        gap: 8px; /* Reducir espacio */
        margin-bottom: 6px; /* Reducir margen inferior */
        align-items: center; /* Centrar verticalmente */
    }
    
    .dup-row2-icon {
        width: 24px; 
        height: 24px; /* Icono más pequeño */
        border-radius: 6px;
        margin-top: 0; /* Eliminar margen superior */
    }
    
    .dup-row2-icon::after {
        width: 6px; 
        height: 6px; /* Punto más pequeño */
    }
    
    .dup-row2-name {
        font-size: 0.78em; /* Texto más pequeño */
        margin-bottom: 4px; /* Reducir margen */
        line-height: 1.3; /* Mejorar legibilidad */
        word-break: break-word; /* Mejor ruptura de palabras */
        overflow-wrap: anywhere; /* Permitir ruptura en cualquier lugar */
    }
    
    .dup-row2-tags {
        gap: 4px; /* Reducir espacio entre tags */
        margin-top: 2px;
    }
    
    /* ── Tags más pequeños ────────────────────────────────── */
    .dup-tag {
        font-size: 0.6em; /* Más pequeño */
        padding: 1px 6px; /* Menos padding */
        letter-spacing: 0.02em;
    }
    
    /* ── Copias/hermanos ────────────────────────────────── */
    .dup-row2-siblings {
        margin: 6px 0 8px 32px; /* Reducir márgenes y indentación */
        gap: 3px; /* Menos espacio entre elementos */
    }
    
    .dup-sibling {
        padding: 4px 8px; /* Menos padding */
        border-radius: 5px; /* Bordes más pequeños */
        font-size: 0.68em; /* Texto más pequeño */
        gap: 5px; /* Menos espacio entre icono y texto */
        line-height: 1.2;
        word-break: break-word;
        overflow-wrap: anywhere;
        min-height: 28px; /* Altura mínima para touch */
        display: flex;
        align-items: center;
    }
    
    .dup-sibling-icon {
        font-size: 0.9em; /* Icono más pequeño */
        flex-shrink: 0;
    }
    
    /* ── Acciones ────────────────────────────────── */
    .dup-row2-actions {
        margin-top: 8px; /* Reducir margen superior */
        padding-top: 8px; /* Reducir padding superior */
    }
    
    .dup-delete-btn {
        padding: 12px 14px; /* Mejor área de toque */
        font-size: 0.72em; /* Texto más pequeño */
        border-radius: 7px; /* Bordes más pequeños */
        gap: 5px; /* Menos espacio entre icono y texto */
        min-height: 44px; /* Altura mínima para touch según guidelines */
        letter-spacing: 0.03em;
        font-weight: 600; /* Menos bold */
    }
    
    .dup-delete-btn svg {
        width: 12px; 
        height: 12px; /* SVG más pequeño */
        flex-shrink: 0;
    }
    
    .dup-delete-btn:hover {
        transform: none; /* Eliminar efecto hover */
    }
    
    .dup-delete-btn:active {
        transform: scale(0.98); /* Efecto de toque */
        transition: transform 0.1s;
    }
    
    /* ── Scrollbar móvil ────────────────────────────────── */
    .dup-list2::-webkit-scrollbar {
        width: 2px; /* Scrollbar más delgado */
    }
    
    .dup-list2::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.15); /* Más visible */
        border-radius: 2px;
    }
    
    /* ── Mejoras de legibilidad ────────────────────────────────── */
    .dup-row2-name,
    .dup-sibling {
        /* Mejorar contraste en móvil */
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }
    
    /* ── Espaciado general ────────────────────────────────── */
    .dup-row2 + .dup-row2 {
        margin-top: 0; /* Eliminar margen entre tarjetas */
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   📱 OPTIMIZACIÓN EXTRA PARA PANTALLAS MUY PEQUEÑAS (< 480px)
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    
    .dup-list2 {
        max-height: 55vh; /* Aún más pequeño en pantallas muy pequeñas */
        margin: 0 -15px; /* Expandir más */
        padding: 0 15px;
    }
    
    .dup-row2 {
        padding: 10px; /* Padding aún más pequeño */
    }
    
    .dup-row2-name {
        font-size: 0.75em; /* Texto ligeramente más grande para legibilidad */
    }
    
    .dup-sibling {
        font-size: 0.65em;
        padding: 3px 6px;
        min-height: 26px;
    }
    
    .dup-delete-btn {
        padding: 10px 12px;
        font-size: 0.7em;
        min-height: 42px;
    }
    
    .dup-row2-siblings {
        margin-left: 28px; /* Menos indentación */
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎯 MEJORAS DE ACCESIBILIDAD TÁCTIL
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    /* Dispositivos táctiles */
    
    .dup-delete-btn {
        min-height: 48px; /* Área de toque recomendada por WCAG */
    }
    
    .dup-row2 {
        /* Mejorar feedback táctil */
        transition: background-color 0.15s ease;
    }
    
    .dup-row2:active {
        background: rgba(255,255,255,0.08);
    }
    
    .dup-delete-btn:active {
        background: rgba(232, 71, 42, 0.2);
        border-color: rgba(232, 71, 42, 0.6);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🔥 SOLUCIÓN DEFINITIVA PARA EL ESPACIO VACÍO EN MODAL DE DUPLICADOS MÓVIL
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    
    /* ── Modal de duplicados específico ────────────────────────────────── */
    #duplicates-modal .modal-content {
        max-height: 90vh !important; /* Usar más espacio de pantalla */
        margin: 20px 10px !important; /* Márgenes más pequeños */
        border-radius: 12px !important;
    }
    
    #duplicates-modal .modal-header {
        padding: 15px 18px !important; /* Reducir padding del header */
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    
    /* 🔥 ESTA ES LA CLAVE - Eliminar el padding excesivo del body */
    #duplicates-modal .modal-body {
        padding: 8px 18px !important; /* Padding mínimo - SOLUCIONA EL ESPACIO VACÍO */
        flex: 1;
        overflow: hidden; /* Evitar scroll del body */
        display: flex;
        flex-direction: column;
    }
    
    #duplicates-modal .modal-footer {
        padding: 12px 18px !important; /* Reducir padding del footer */
        border-top: 1px solid rgba(255,255,255,0.08);
        flex-shrink: 0; /* No permitir que se encoja */
    }
    
    /* ── Título más compacto ────────────────────────────────── */
    #duplicates-modal .dup-modal-title h2 {
        font-size: 1.1em !important;
        margin: 0 !important;
        line-height: 1.3;
    }
    
    #duplicates-modal .dup-modal-subtitle {
        font-size: 0.72em !important;
        margin: 2px 0 0 !important;
        line-height: 1.3;
        opacity: 0.8;
    }
    
    #duplicates-modal .dup-modal-icon {
        width: 26px !important;
        height: 26px !important;
        font-size: 14px !important;
    }
    
    /* ── Resumen de tags más compacto ────────────────────────────────── */
    #duplicates-modal .dup-summary-detail {
        margin: 0 0 8px 0 !important; /* Eliminar margen superior */
        gap: 6px;
    }
    
    /* ── Lista de duplicados ocupa el espacio restante ────────────────────────────────── */
    #duplicates-modal .dup-list2 {
        flex: 1 !important; /* Ocupar todo el espacio disponible */
        max-height: none !important; /* Eliminar altura máxima fija */
        margin: 0 !important;
        padding: 0 !important;
        overflow-y: auto; /* Permitir scroll solo en la lista */
    }
    
    /* ── Botones del footer más compactos ────────────────────────────────── */
    #duplicates-modal .dup-modal-footer {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    #duplicates-modal .dup-modal-footer .btn {
        flex: 1;
        min-width: 120px;
        padding: 10px 12px !important;
        font-size: 0.8em !important;
    }
    
    /* ── Botón de cerrar más accesible ────────────────────────────────── */
    #duplicates-modal .modal-close {
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   📱 OPTIMIZACIÓN EXTRA PARA PANTALLAS MUY PEQUEÑAS (< 480px)
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    
    #duplicates-modal .modal-content {
        margin: 10px 5px !important; /* Márgenes aún más pequeños */
        max-height: 95vh !important; /* Usar casi toda la pantalla */
    }
    
    #duplicates-modal .modal-header {
        padding: 12px 15px !important;
    }
    
    #duplicates-modal .modal-body {
        padding: 6px 15px !important; /* Padding mínimo absoluto */
    }
    
    #duplicates-modal .modal-footer {
        padding: 10px 15px !important;
    }
    
    #duplicates-modal .dup-modal-title h2 {
        font-size: 1.05em !important;
    }
    
    #duplicates-modal .dup-modal-subtitle {
        font-size: 0.7em !important;
    }
    
    /* Botones apilados verticalmente en pantallas muy pequeñas */
    #duplicates-modal .dup-modal-footer {
        flex-direction: column;
        gap: 6px;
    }
    
    #duplicates-modal .dup-modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   🎯 MEJORAS DE ACCESIBILIDAD Y UX PARA MODAL DE DUPLICADOS
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    /* Dispositivos táctiles */
    
    #duplicates-modal .modal-close {
        min-width: 44px !important;
        min-height: 44px !important; /* Área de toque recomendada */
    }
    
    #duplicates-modal .dup-modal-footer .btn {
        min-height: 44px !important;
    }
    
    /* Feedback táctil para el modal */
    #duplicates-modal .modal-close:active {
        background: rgba(255,255,255,0.1) !important;
        transform: scale(0.95);
    }
    
    #duplicates-modal .dup-modal-footer .btn:active {
        transform: scale(0.98);
        background: rgba(94, 114, 228, 0.8) !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   🎯 GRID DE BOTONES DE ACCIONES (Generar .STRM, Renombrar, etc.)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Desktop: Grid responsive con mínimo 200px por botón */
#files-view > div > div[style*="grid-template-columns"] {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 12px !important;
}

/* Móvil: Botones apilados verticalmente */
@media (max-width: 768px) {
    #files-view > div > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    #files-view > div > div[style*="grid-template-columns"] .btn {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 0.9em !important;
    }
}

/* Tablet: 2 columnas */
@media (min-width: 769px) and (max-width: 1024px) {
    #files-view > div > div[style*="grid-template-columns"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ── TMDB Review Grid: responsive ─────────────────────────────────────────── */
.tmdb-review-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 1024px) {
    .tmdb-review-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tmdb-review-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Spinner para cards TMDB cargando */
@keyframes spin {
    to { transform: rotate(360deg); }
}
