/* Manual library specific styles */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.category-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.manual-count {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
}

.add-manual-section {
    text-align: center;
    margin-top: 40px;
}

.add-manual-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.add-manual-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

/* Manual Gallery */
.gallery-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
    flex-wrap: wrap;
}

.add-manual-btn-gallery {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    margin-left: auto;
}

.add-manual-btn-gallery:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.back-btn {
    background: #ecf0f1;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #d5dbdb;
    transform: translateY(-1px);
}

#categoryTitle {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0;
    text-transform: capitalize;
}

.manuals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.manual-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.delete-manual-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.manual-card:hover .delete-manual-btn {
    opacity: 1;
}

.delete-manual-btn:hover {
    background: rgba(192, 57, 43, 1);
    transform: scale(1.1);
}

.manual-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.manual-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

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

.manual-card:hover .manual-image img {
    transform: scale(1.05);
}

.manual-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.manual-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.view-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: auto;
}

.view-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.download-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 10px;
}

.manual-card:hover .download-overlay {
    opacity: 1;
}

.download-icon {
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
}

.download-text {
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #95a5a6;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 30px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 30px 0;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #2c3e50;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #ecf0f1;
    color: #7f8c8d;
}

.manual-form {
    padding: 0 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}

.form-actions button {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.secondary-btn {
    background: #ecf0f1;
    color: #2c3e50;
}

.secondary-btn:hover {
    background: #d5dbdb;
    transform: translateY(-1px);
}

.submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    position: relative;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Success message */
.success-message {
    background: #d5f4e6;
    color: #27ae60;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #27ae60;
    font-weight: 500;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .category-card {
        padding: 25px 15px;
    }
    
    .category-icon {
        font-size: 2.5rem;
    }
    
    .manuals-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .manual-image {
        height: 150px;
    }
    
    .manual-info {
        padding: 12px;
    }
    
    .manual-info h4 {
        font-size: 0.9rem;
    }
    
    .view-pdf-btn {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-header {
        padding: 20px 20px 0;
    }
    
    .manual-form {
        padding: 0 20px 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .manuals-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
    
    .manual-image {
        height: 130px;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
}




