/* ============================================================
   LIBRERIA MANUALI - VISTA A CARTELLE
   File: manuals-folders.css
   ============================================================ */

/* Container principale */
.manuals-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

/* Cartella categoria */
.category-folder {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.category-folder:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-color: #667eea;
}

/* Header cartella */
.folder-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.folder-header:hover {
    background: #f8f9fa;
}

.folder-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.folder-info {
    flex: 1;
}

.folder-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.folder-count {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #999;
}

.folder-arrow {
    font-size: 14px;
    color: #999;
    transition: transform 0.3s ease;
}

/* Contenuto cartella */
.folder-content {
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    padding: 10px 20px 20px 20px;
}

/* Singolo manuale nella cartella */
.manual-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.manual-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.manual-item .manual-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.manual-item .manual-info {
    flex: 1;
    min-width: 0;
}

.manual-item .manual-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manual-item .manual-desc {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manual-item .manual-size {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 4px;
}

.manual-item .manual-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.manual-item .manual-actions .btn {
    padding: 6px 10px;
    font-size: 14px;
    min-width: auto;
}

/* Campo di ricerca */
#manual-search {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#manual-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Modal upload */
#upload-manual-modal .form-group {
    margin-bottom: 20px;
}

#upload-manual-modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

#upload-manual-modal input[type="text"],
#upload-manual-modal textarea,
#upload-manual-modal input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

#upload-manual-modal textarea {
    resize: vertical;
}

#upload-manual-modal input[type="file"] {
    border: 2px dashed #ddd;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

#upload-manual-modal input[type="file"]:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

#upload-manual-modal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* Progress bar upload */
#upload-progress {
    margin-top: 20px;
}

#upload-progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .folder-header {
        padding: 15px;
    }
    
    .folder-icon {
        font-size: 32px;
    }
    
    .folder-title {
        font-size: 16px;
    }
    
    .manual-item {
        flex-wrap: wrap;
    }
    
    .manual-item .manual-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    #manual-search {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .folder-header {
        padding: 12px;
        gap: 10px;
    }
    
    .folder-icon {
        font-size: 28px;
    }
    
    .folder-title {
        font-size: 14px;
    }
    
    .folder-count {
        font-size: 12px;
    }
    
    .manual-item {
        padding: 10px;
    }
    
    .manual-item .manual-icon {
        font-size: 24px;
    }
    
    .manual-item .manual-name {
        font-size: 13px;
    }
}
