/* archivos-styles.css */

/* --- Alert Messages --- */
.alert {
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
}

.alert.success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #d4edda;
}

.alert.error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #f8d7da;
}

/* --- Toolbar de Archivos --- */
.archivos-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(171, 71, 188, 0.3);
}

.search-box {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid rgba(171, 71, 188, 0.5);
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--color-texto);
    font-size: 1rem;
    font-family: var(--font-texto);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-neon);
    box-shadow: 0 0 15px rgba(171, 71, 188, 0.3);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-btn {
    padding: 12px 20px;
    background: linear-gradient(145deg, var(--color-neon), var(--color-neon-glow));
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--color-neon);
}

.upload-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-upload,
.btn-upload-link {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-upload {
    background: linear-gradient(145deg, var(--color-verde), var(--color-verde-hover));
    color: white;
    border: none;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.btn-upload-link {
    background: linear-gradient(145deg, #2196f3, #1976d2);
    color: white;
    border: none;
}

.btn-upload-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
}

.btn-login-prompt {
    background: rgba(171, 71, 188, 0.2);
    border: 2px solid var(--color-neon);
    color: var(--color-neon);
}

.btn-login-prompt:hover {
    background: var(--color-neon);
    color: white;
}

/* --- Filtros de Categoría --- */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.category-tag {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(171, 71, 188, 0.3);
    border-radius: 25px;
    color: var(--color-texto);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.category-tag:hover,
.category-tag.active {
    background: var(--color-neon);
    border-color: var(--color-neon);
    color: white;
    box-shadow: 0 0 10px rgba(171, 71, 188, 0.5);
}

/* --- Grid de Archivos --- */
.archivos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.archivo-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 2px solid rgba(171, 71, 188, 0.3);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.archivo-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-neon);
    box-shadow: 0 15px 40px rgba(171, 71, 188, 0.3);
}

.archivo-cover {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.archivo-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.archivo-card:hover .archivo-cover img {
    transform: scale(1.1);
}

.archivo-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.archivo-type-badge.archivo {
    background: linear-gradient(145deg, var(--color-verde), var(--color-verde-hover));
    color: white;
}

.archivo-type-badge.link {
    background: linear-gradient(145deg, #2196f3, #1976d2);
    color: white;
}

.archivo-info {
    padding: 15px;
}

.archivo-title {
    font-family: var(--font-texto);
    font-size: 1rem;
    margin: 0 0 10px 0;
    color: var(--color-texto);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archivo-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mini-tag {
    padding: 3px 10px;
    background: rgba(171, 71, 188, 0.2);
    border-radius: 15px;
    font-size: 0.75rem;
    color: var(--color-neon);
}

/* --- Meta Section (Categories + Likes) --- */
.archivo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.archivo-likes {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.archivo-likes:hover {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
}

.archivo-likes.liked,
.archivo-likes i.fas {
    color: #ff4757;
}

.archivo-likes i {
    font-size: 1rem;
    transition: all 0.2s ease;
}

.archivo-likes:hover i {
    transform: scale(1.2);
}

.archivo-likes .likes-count {
    font-weight: 500;
}

/* --- No Files Message --- */
.no-files {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.no-files i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--color-neon);
    opacity: 0.5;
}

.no-files p {
    font-size: 1.1rem;
    margin: 10px 0;
}

/* --- Modal de Subida (Mejorado) --- */
.modal-upload {
    max-width: 520px;
    text-align: left;
}

.modal-upload h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.modal-upload .form-group {
    margin-bottom: 20px;
}

.modal-upload .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-texto);
    font-family: var(--font-titulo);
    font-size: 0.95rem;
}

.modal-upload .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(171, 71, 188, 0.4);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--color-texto);
    font-size: 1rem;
    font-family: var(--font-texto);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modal-upload .form-control:focus {
    outline: none;
    border-color: var(--color-neon);
    box-shadow: 0 0 15px rgba(171, 71, 188, 0.3);
}

.modal-upload .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* File Input Styling */
.modal-upload input[type="file"] {
    padding: 10px;
    background: rgba(171, 71, 188, 0.1);
    border: 2px dashed rgba(171, 71, 188, 0.5);
    cursor: pointer;
}

.modal-upload input[type="file"]:hover {
    border-color: var(--color-neon);
    background: rgba(171, 71, 188, 0.15);
}

.modal-upload input[type="file"]::file-selector-button {
    padding: 8px 16px;
    margin-right: 15px;
    background: linear-gradient(145deg, var(--color-neon), var(--color-neon-glow));
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-texto);
    transition: all 0.3s ease;
}

.modal-upload input[type="file"]::file-selector-button:hover {
    transform: scale(1.05);
}

.modal-upload small {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.categories-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(171, 71, 188, 0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.checkbox-label:hover {
    border-color: var(--color-neon);
    background: rgba(171, 71, 188, 0.15);
    color: white;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label:has(input:checked) {
    background: var(--color-neon);
    border-color: var(--color-neon);
    color: white;
    box-shadow: 0 0 15px rgba(171, 71, 188, 0.4);
}

.btn-full {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

/* --- Modal de Vista de Archivo --- */
.modal-file-view {
    max-width: 700px;
}

.file-view-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-view-image {
    width: 100%;
    max-height: 350px;
    overflow: hidden;
    border-radius: 10px;
}

.file-view-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
}

.file-view-details {
    text-align: center;
}

.file-view-details h2 {
    margin-bottom: 10px;
}

.file-author {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.file-author span {
    color: var(--color-neon);
    font-weight: bold;
}

.file-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

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

.btn-copy {
    background: linear-gradient(145deg, #ff9800, #f57c00);
    color: white;
}

.btn-copy:hover {
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
    transform: translateY(-2px);
}

.btn-delete {
    background: linear-gradient(145deg, #dc3545, #c82333);
    color: white;
}

.btn-delete:hover {
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
}

.file-actions-secondary {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .archivos-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .upload-buttons {
        justify-content: center;
    }

    .archivos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .archivo-cover {
        height: 120px;
    }

    .archivo-info {
        padding: 10px;
    }

    .archivo-title {
        font-size: 0.9rem;
    }

    .file-view-content {
        text-align: center;
    }

    .file-actions {
        flex-direction: column;
    }

    .file-actions .btn {
        width: 100%;
    }

    .file-actions-secondary {
        width: 100%;
    }

    .file-actions-secondary .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {

    .btn-upload,
    .btn-upload-link {
        width: 100%;
        justify-content: center;
    }

    .category-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }

    .category-tag {
        flex-shrink: 0;
    }
}