/* Content Portal Plugin Styles */

.content-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Filters Section */
.content-portal-filters {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
    font-size: 14px;
}

.cp-filter {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.cp-filter:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.cp-filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.cp-apply-filters {
    background: #007cba;
    color: #fff;
}

.cp-apply-filters:hover {
    background: #005a87;
}

.cp-clear-filters {
    background: #6c757d;
    color: #fff;
}

.cp-clear-filters:hover {
    background: #545b62;
}

/* Content Grid */
.content-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Content Item */
.content-portal-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    position: relative;
}

.content-portal-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #007cba;
}

.content-portal-featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.featured-text {
    background: #ffc107;
    color: #212529;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.content-portal-item-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content-portal-item-thumbnail {
    position: relative;
    overflow: hidden;
}

.thumbnail-link {
    display: block;
    text-decoration: none;
}

.content-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.content-portal-item:hover .content-thumbnail {
    transform: scale(1.05);
}

.content-portal-item-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-portal-item-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}

.content-portal-item-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.content-portal-item-title a:hover {
    color: #007cba;
}

.content-portal-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #6c757d;
}

.content-portal-item-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.content-portal-item-meta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.content-portal-item-excerpt {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #495057;
    flex: 1;
}

.content-portal-item-excerpt p {
    margin: 0;
}

.content-portal-item-taxonomies {
    margin-bottom: 20px;
}

.taxonomy-label {
    font-weight: 600;
    color: #495057;
    margin-right: 8px;
    font-size: 13px;
}

.content-portal-category,
.content-portal-tag {
    display: inline-block;
    margin: 2px 4px 2px 0;
}

.content-portal-category a,
.content-portal-tag a {
    display: inline-block;
    padding: 4px 8px;
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    border-radius: 12px;
    font-size: 12px;
    transition: all 0.15s ease-in-out;
}

.content-portal-category a:hover,
.content-portal-tag a:hover {
    background: #007cba;
    color: #fff;
}

.content-portal-item-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.content-portal-item-actions-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.content-portal-item-actions-right {
    display: flex;
    gap: 10px;
}

.content-portal-read-more {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s ease-in-out;
}

.content-portal-read-more:hover {
    color: #005a87;
}

.content-portal-item-actions {
    display: flex;
    gap: 10px;
}

/* Download Button Styles */
.content-portal-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    position: relative;
}

.content-portal-download-btn:hover {
    background: #218838;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.content-portal-download-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.content-portal-download-btn .download-info {
    font-size: 11px;
    opacity: 0.8;
    margin-left: 5px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

/* File Type Icons */
.content-portal-download-btn[href*=".pdf"] .dashicons::before {
    content: "\f469"; /* PDF icon */
}

.content-portal-download-btn[href*=".doc"] .dashicons::before,
.content-portal-download-btn[href*=".docx"] .dashicons::before {
    content: "\f491"; /* Document icon */
}

.content-portal-download-btn[href*=".xls"] .dashicons::before,
.content-portal-download-btn[href*=".xlsx"] .dashicons::before {
    content: "\f493"; /* Spreadsheet icon */
}

.content-portal-download-btn[href*=".ppt"] .dashicons::before,
.content-portal-download-btn[href*=".pptx"] .dashicons::before {
    content: "\f492"; /* Presentation icon */
}

.content-portal-download-btn[href*=".zip"] .dashicons::before,
.content-portal-download-btn[href*=".rar"] .dashicons::before {
    content: "\f317"; /* Archive icon */
}

.cp-bookmark-btn,
.cp-share-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6c757d;
    transition: all 0.15s ease-in-out;
}

.cp-bookmark-btn:hover,
.cp-share-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

/* Pagination */
.content-portal-pagination {
    margin: 30px 0;
    text-align: center;
}

.content-portal-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #007cba;
    transition: all 0.15s ease-in-out;
}

.content-portal-pagination .page-numbers:hover,
.content-portal-pagination .page-numbers.current {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.content-portal-pagination .prev,
.content-portal-pagination .next {
    font-weight: 600;
}

/* Loading State */
.content-portal-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.content-portal-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.content-portal-no-results p {
    font-size: 18px;
    margin: 0;
}

/* Pagination Info */
.content-portal-pagination-info {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-portal {
        padding: 15px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .filter-actions {
        margin-left: 0;
        justify-content: center;
    }
    
    .content-portal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .content-portal-item-content {
        padding: 15px;
    }
    
    .content-portal-item-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .content-portal-item-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .content-portal {
        padding: 10px;
    }
    
    .content-portal-filters {
        padding: 15px;
    }
    
    .content-portal-item-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* ========================================
   TABLE LAYOUT STYLES
   ======================================== */

.content-portal-table {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Category Sections */
.content-category-section {
    margin-bottom: 40px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.content-category-title {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #fff;
    margin: 0;
    padding: 20px;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-category-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

/* Tag Sections */
.content-tag-section {
    margin: 0;
    border-bottom: 1px solid #e9ecef;
}

.content-tag-section:last-child {
    border-bottom: none;
}

.content-tag-title {
    background: #f8f9fa;
    color: #495057;
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e9ecef;
}

.content-tag-title .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #6c757d;
}

.item-count {
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    margin-left: auto;
}

/* Table Styles */
.content-table-wrapper {
    overflow-x: auto;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.content-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.content-table tr:hover {
    background: #f8f9fa;
}

/* Table Columns */
.col-title {
    width: 40%;
}

.col-excerpt {
    width: 45%;
}

.col-actions {
    width: 15%;
    text-align: center;
}

/* Item Title */
.item-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.title-link {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
}

.title-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.featured-badge {
    display: inline-block;
    background: #ffc107;
    color: #212529;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Item Excerpt */
.item-excerpt {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* Item Meta */
.item-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-meta > div {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
}

.item-meta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

/* Item Actions */
.item-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    font-size: 16px;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.read-more-btn {
    background: #007cba;
    color: #fff;
}

.read-more-btn:hover {
    background: #005a87;
}

.download-btn {
    background: #28a745;
    color: #fff;
}

.download-btn:hover {
    background: #1e7e34;
}

.external-btn {
    background: #17a2b8;
    color: #fff;
}

.external-btn:hover {
    background: #117a8b;
}

.bookmark-btn {
    background: #ffc107;
    color: #212529;
}

.bookmark-btn:hover {
    background: #e0a800;
}

.share-btn {
    background: #6f42c1;
    color: #fff;
}

.share-btn:hover {
    background: #5a32a3;
}

.no-download {
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
    text-align: center;
}

/* Enhanced Download Button Styles */
.download-btn,
.external-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    min-width: 120px;
    justify-content: center;
}

.download-btn:hover,
.external-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

/* Table Responsive Design */
@media (max-width: 1024px) {
    .content-portal-table {
        padding: 15px;
    }
    
    .col-title {
        width: 35%;
    }
    
    .col-excerpt {
        width: 50%;
    }
    
    .col-actions {
        width: 15%;
    }
}

@media (max-width: 768px) {
    .content-portal-table {
        padding: 10px;
    }
    
    .content-category-title {
        font-size: 20px;
        padding: 15px;
    }
    
    .content-tag-title {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    .content-table th,
    .content-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .col-title {
        width: 40%;
    }
    
    .col-excerpt {
        width: 35%;
    }
    
    .col-actions {
        width: 25%;
    }
    
    .download-btn,
    .external-btn {
        min-width: 100px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .content-portal-table {
        padding: 5px;
    }
    
    .content-category-title {
        font-size: 18px;
        padding: 12px;
    }
    
    .content-tag-title {
        font-size: 15px;
        padding: 10px 12px;
    }
    
    .content-table-wrapper {
        font-size: 12px;
    }
    
    .content-table th,
    .content-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .item-actions {
        gap: 4px;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}
