/* Knowledge Center Frontend Styles */

.knowledge-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.knowledge-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.knowledge-card-image {
    display: block;
}

.knowledge-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.knowledge-card-body {
    padding: 16px;
}

.knowledge-card-title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.knowledge-card-title a {
    color: #1f2937;
    text-decoration: none;
}

.knowledge-card-title a:hover {
    color: #0073aa;
}

.knowledge-card-excerpt {
    margin: 0 0 14px;
    color: #4b5563;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.knowledge-card-link {
    display: inline-block;
    color: #0073aa;
    font-weight: 600;
    text-decoration: none;
}

.knowledge-card-link:hover {
    text-decoration: underline;
}

.knowledge-pagination {
    margin: 24px 0;
}

.knowledge-pagination ul {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.knowledge-pagination a,
.knowledge-pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #111827;
}

.knowledge-pagination .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.knowledge-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    margin-top: 150px;
}

.knowledge-article {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.knowledge-preview-image {
    margin-bottom: 30px;
    text-align: center;
}

.knowledge-preview-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.knowledge-gallery {
    margin-bottom: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.gallery-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

.knowledge-title {
    font-size: 32px;
    margin-bottom: 15px;
    color: #333;
}

.knowledge-meta {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #666;
    font-size: 14px;
}

.publish-date, .published-by {
    margin-right: 20px;
}

.knowledge-description {
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
}

.knowledge-downloads,
.knowledge-videos,
.knowledge-reviews {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.downloads-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.download-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.download-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.download-link {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: #333;
}

.download-title {
    flex: 1;
    font-weight: 500;
}

.download-icon {
    font-size: 24px;
    margin-left: 10px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.video-item {
    cursor: pointer;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    border-radius: 4px;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255,0,0,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.video-item:hover .play-button {
    background: #ff0000;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-title {
    margin-top: 10px;
    font-size: 16px;
    text-align: center;
}

/* Reviews Section */
.reviews-list {
    margin-bottom: 30px;
}

.review-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.reviewer-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.reviewer-name {
    font-weight: bold;
    color: #333;
}

.review-date {
    color: #666;
    font-size: 14px;
}

.review-rating {
    color: #ffc107;
    font-size: 18px;
    letter-spacing: 2px;
}

.review-content {
    line-height: 1.6;
    color: #555;
}

/* Review Form */
.review-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group select {
    height: 40px;
}

.form-group textarea {
    resize: vertical;
}

.submit-review {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.submit-review:hover {
    background: #0056b3;
}

.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-required {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffeeba;
}

.login-required a {
    color: #856404;
    font-weight: bold;
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    position: relative;
    width: 80%;
    max-width: 900px;
    margin: 50px auto;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
}

.close-modal {
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

.close-modal:hover {
    color: #000;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .knowledge-title {
        font-size: 24px;
    }
    
    .modal-content {
        width: 95%;
        margin: 30px auto;
    }
}