/**
 * Resources Plugin Styles
 */

/* Archive Container */
.resources-archive-container {
    padding: 40px 0;
    background: #f8f9fa;
    min-height: 600px;
}

/* Header */
.resources-header {
    text-align: center;
    margin-bottom: 40px;
}

.resources-title {
    font-size: 36px;
    color: #164170;
    margin: 0 0 20px;
    font-weight: 700;
}

/* Search and Filter Controls */
.resources-controls {
    margin-bottom: 40px;
}

/* Search Box */
.resources-search-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.resources-search-input {
    flex: 1;
    padding: 12px 55px 12px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    background: white;
}

.resources-search-input:focus {
    border-color: #00a77e;
    box-shadow: 0 0 0 3px rgba(0, 167, 126, 0.1);
}

.resources-search-btn,
.resources-clear-btn {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    transition: all 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.resources-search-btn {
    right: 8px;
    background: #00a77e;
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.resources-clear-btn {
    right: 50px;
    color: #999;
}

.resources-search-btn:hover {
    background: #008c6a;
    transform: translateY(-50%) scale(1.05);
}

.resources-clear-btn:hover {
    color: #d32f2f;
}

.resources-search-btn .dashicons,
.resources-clear-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.resources-search-btn .dashicons:before,
.resources-clear-btn .dashicons:before {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Loading State */
.resources-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
}

/* Search Results */
.search-results-section {
    margin-bottom: 40px;
}

.search-results-heading {
    font-size: 24px;
    color: #164170;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #00a77e;
}

/* Category Filter */
.resources-filter {
    text-align: center;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 20px 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-button {
    padding: 10px 20px;
    background: #00a77e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.filter-button:hover {
    background: #008866;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.filter-button.active {
    background: #164170;
}

.filter-button.subcategory {
    background: #6c757d;
    font-size: 13px;
    padding: 8px 16px;
}

.filter-button.subcategory:hover {
    background: #5a6268;
}

.filter-button.subcategory.active {
    background: #0c3b6f;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.resources-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.resources-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.resources-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Resource Item */
.resource-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.resource-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.resource-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Resource Thumbnail */
.resource-thumbnail {
    width:auto;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 3px solid #00a77e;
}

.resource-thumbnail img {
    height: 100%;
    object-fit: cover;
}

.resource-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
}

.resource-placeholder .dashicons {
    font-size: 60px;
    color: #adb5bd;
}

/* Resource Content */
.resource-content {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.resource-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.resource-title a {
    color: #164170;
    text-decoration: none;
    transition: color 0.3s ease;
}

.resource-title a:hover {
    color: #00a77e;
}

/* Resource Buttons Container */
.resource-buttons {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Resource Button */
.resource-button {
    display: inline-block;
    padding: 10px 20px;
    background: #00a77e;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1;
}

.resource-button:hover {
    background: #008866;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Secondary Button */
.resource-button-secondary {
    background: #164170;
}

.resource-button-secondary:hover {
    background: #0c3b6f;
}

/* Loading State */
.resources-loading {
    text-align: center;
    padding: 40px;
}

.resources-loading .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00a77e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Resources Found */
.no-resources-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 18px;
}

/* Category Sections */
.resources-by-category {
    padding: 20px 0;
}

.resource-category-section {
    margin-bottom: 60px;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.category-heading {
    font-size: 28px;
    font-weight: 700;
    color: #164170;
    margin: 0 0 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #00a77e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resource-subcategory-section {
    margin-bottom: 40px;
}

.resource-subcategory-section:last-child {
    margin-bottom: 0;
}

.subcategory-heading {
    font-size: 20px;
    font-weight: 600;
    color: #0c3b6f;
    margin: 0 0 20px;
    padding-left: 20px;
    position: relative;
}

.subcategory-heading:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: #00a77e;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .resources-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .resources-grid.columns-3,
    .resources-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resources-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .resources-grid,
    .resources-grid.columns-2,
    .resources-grid.columns-3,
    .resources-grid.columns-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-button {
        width: 100%;
    }
    
    .resources-title {
        font-size: 24px;
    }
    
    .resource-thumbnail {
        height: 150px;
    }
    
    .resource-category-section {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .category-heading {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .subcategory-heading {
        font-size: 18px;
    }
}

/* Admin Styles */
.post-type-resource .column-thumbnail {
    width: 80px;
}

.post-type-resource .column-thumbnail img {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
}

.post-type-resource .column-resource_category {
    width: 20%;
}

.post-type-resource .column-resource_link {
    width: 15%;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #d32f2f;
    background: #ffebee;
    border-radius: 8px;
    margin: 20px auto;
    border: 1px solid #ffcdd2;
}

/* View Toggle Controls */
.resources-controls-top {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.resources-view-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-right: 30px;
    max-width: 100%;
}

.resources-view-toggle {
    display: flex;
    gap: 10px;
}

.view-toggle-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #164170;
    color: #164170;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
}

.view-toggle-btn:hover {
    background: #f0f4f8;
    border-color: #0c3b6f;
}

.view-toggle-btn.active {
    background: #164170;
    color: white;
    border-color: #164170;
}

.view-toggle-btn.active:hover {
    background: #0c3b6f;
    border-color: #0c3b6f;
}

/* Table View Styles */
.resources-table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 40px;
}

.resources-table {
    width: 100%;
    border-collapse: collapse;
}

.resources-table thead {
    background: #164170;
    color: white;
}

.resources-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resources-table th:first-child {
    width: 100px;
    padding: 0;
}

.resources-table th:last-child {
    width: 150px;
    padding: 0;
}

.resources-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.resources-table tbody tr:hover {
    background: #f8f9fa;
}

.resources-table td {
    padding: 15px;
    vertical-align: middle;
}

.resource-table-thumbnail {
    width: 100px;
}

.resource-table-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.resource-table-thumbnail .resource-placeholder-small {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-table-thumbnail .dashicons {
    font-size: 30px;
    color: #adb5bd;
}

.resource-table-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.resource-table-title h3 a {
    color: #164170;
    text-decoration: none;
    transition: color 0.3s ease;
}

.resource-table-title h3 a:hover {
    color: #00a77e;
    text-decoration: underline;
}

.resource-table-action {
    text-align: center;
}

.resource-table-action .resource-button {
    margin: 0;
    font-size: 13px;
    padding: 8px 16px;
}

/* Table view class for container */
.table-view .resources-grid {
    display: block;
}

/* Responsive Table */
@media (max-width: 992px) {
    .resources-table {
        font-size: 14px;
    }
    
    .resources-table th,
    .resources-table td {
        padding: 10px;
    }
    
    .resource-table-thumbnail {
        width: 80px;
    }
    
    .resource-table-thumbnail img,
    .resource-table-thumbnail .resource-placeholder-small {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .resources-controls-top {
        flex-direction: column;
        align-items: stretch;
    }
    
    .resources-view-toggle-wrapper {
        justify-content: center;
        margin-top: 15px;
        padding-right: 0;
    }
    
    .resources-view-toggle {
        justify-content: center;
        width: 100%;
    }
    
    .view-toggle-btn {
        flex: 1;
    }
    
    
    .resources-table th,
    .resources-table td {
        padding: 8px;
        font-size: 13px;
    }
    
    .resource-table-title h3 {
        font-size: 14px;
    }
    
    .resource-table-action .resource-button {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Single Resource Page Styles */
.resource-single-container {
    padding: 40px 0;
    background: #f8f9fa;
    min-height: 600px;
}

.resource-single {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-width: 1200px;
    margin: 0 auto;
}

/* Breadcrumbs */
.resource-breadcrumbs {
    margin-bottom: 30px;
    font-size: 14px;
    color: #6c757d;
}

.resource-breadcrumbs a {
    color: #164170;
    text-decoration: none;
    transition: color 0.3s ease;
}

.resource-breadcrumbs a:hover {
    color: #0c3b6f;
    text-decoration: underline;
}

.resource-breadcrumbs .separator {
    margin: 0 10px;
    color: #adb5bd;
}

.resource-breadcrumbs .current {
    color: #495057;
    font-weight: 600;
}

/* Single Resource Header */
.resource-single-header {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.resource-single-title {
    font-size: 36px;
    color: #164170;
    margin: 0 0 20px;
    font-weight: 700;
    line-height: 1.2;
}

.resource-single-excerpt {
    font-size: 18px;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.resource-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
}

.resource-single-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.resource-single-meta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.resource-single-meta a {
    color: #164170;
    text-decoration: none;
}

.resource-single-meta a:hover {
    color: #0c3b6f;
    text-decoration: underline;
}

/* Two Column Layout */
.resource-single-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    margin-top: 30px;
}

.resource-single-main {
    min-width: 0; /* Prevent grid blowout */
}

.resource-single-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-sizing: border-box;
}

/* Single Resource Thumbnail */
.resource-single-thumbnail {
    margin-bottom: 20px;
    text-align: center;
    background: white;
    border-radius: 8px;
    position: relative;
}

.resource-single-thumbnail img {
    width: 100%;
    height: auto;
    display: block !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-width: 100%;
    visibility: visible !important;
    opacity: 1 !important;
}

.resource-placeholder-large {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.resource-placeholder-large .dashicons {
    font-size: 80px;
    color: #adb5bd;
}

/* Resource CTA Button */
.resource-single-cta {
    text-align: center;
    margin: 0;
}

.resource-button-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    background: #00a77e;
    color: white !important;
    text-decoration: none !important;
    border-radius: 5px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 167, 126, 0.2);
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-button-large:hover {
    background: #008866;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 167, 126, 0.3);
}

.resource-button-large .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Resource Info Text */
.resource-single-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.resource-info-text {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}

.resource-info-text .dashicons {
    font-size: 16px;
    color: #00a77e;
    flex-shrink: 0;
}

/* Single Resource Content */
.resource-single-content {
    margin: 30px 0;
    font-size: 16px;
    line-height: 1.8;
    color: #495057;
}

.resource-single-content h2 {
    font-size: 28px;
    color: #164170;
    margin: 30px 0 20px;
    font-weight: 600;
}

.resource-single-content h3 {
    font-size: 22px;
    color: #164170;
    margin: 25px 0 15px;
    font-weight: 600;
}

.resource-single-content h4 {
    font-size: 18px;
    color: #164170;
    margin: 20px 0 10px;
    font-weight: 600;
}

.resource-single-content p {
    margin-bottom: 20px;
}

.resource-single-content ul,
.resource-single-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.resource-single-content li {
    margin-bottom: 10px;
}

.resource-single-content blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background: #f8f9fa;
    border-left: 4px solid #00a77e;
    font-style: italic;
    color: #6c757d;
}

.resource-single-content a {
    color: #00a77e;
    text-decoration: underline;
}

.resource-single-content a:hover {
    color: #008866;
}

.resource-single-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
}

/* Related Resources */
.related-resources {
    margin-top: 60px;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
}

.related-resources-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.related-resources h2 {
    font-size: 28px;
    color: #164170;
    margin: 0;
    font-weight: 700;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #00a77e;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.view-all-link:hover {
    color: #008866;
    gap: 10px;
}

.view-all-link .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Responsive Single Resource */
@media (max-width: 992px) {
    .resource-single-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .resource-single-sidebar {
        position: static;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .resource-single {
        padding: 20px;
    }
    
    .resource-single-title {
        font-size: 28px;
    }
    
    .resource-single-excerpt {
        font-size: 16px;
    }
    
    .resource-single-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .resource-single-layout {
        gap: 20px;
    }
    
    .resource-single-sidebar {
        max-width: 100%;
    }
    
    .resource-button-large {
        font-size: 15px;
        padding: 12px 20px;
    }
    
    .resource-single-content {
        font-size: 15px;
    }
    
    .related-resources {
        padding: 20px;
    }
    
    .related-resources-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .related-resources h2 {
        font-size: 24px;
    }
    
    .view-all-link {
        font-size: 14px;
    }
}

/* Responsive Design for Search */
@media (max-width: 768px) {
    .resources-search-box {
        max-width: 100%;
    }
    
    .resources-search-input {
        font-size: 14px;
        padding: 10px 50px 10px 15px;
    }
    
    .resources-search-btn {
        right: 5px;
        width: 32px;
        height: 32px;
    }
    
    .resources-clear-btn {
        right: 42px;
    }
    
    .resources-search-btn .dashicons,
    .resources-clear-btn .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    .resources-search-btn .dashicons:before,
    .resources-clear-btn .dashicons:before {
        font-size: 16px;
    }
}
/* Equal height grid items */
.resources-grid {
    align-items: stretch;
}
.resource-item {
    height: 100%;
}
.resource-thumbnail {
    flex: 1;
}
.resource-content {
    flex-shrink: 0;
}
.resource-buttons {
    flex-shrink: 0;
}

/* Fix equal height - title area consistent */
.resource-content {
    min-height: 70px;
    display: flex;
    align-items: flex-start;
}
.resource-item-link {
    flex: 1;
    display: flex;
}
.resource-item .resource-buttons {
    margin-top: auto;
}
