/* Portfolio Categories Widget Styles - Production Ready */
.portfolio-categories-widget {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
}

.portfolio-categories-widget *,
.portfolio-categories-widget *::before,
.portfolio-categories-widget *::after {
    box-sizing: border-box;
}

.portfolio-categories-container {
    display: flex;
    gap: 40px;
    min-height: 600px;
}

/* Sidebar Styles */
.portfolio-categories-sidebar {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.portfolio-categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portfolio-category-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
    font-weight: 500;
    border: none;
    background: transparent;
    text-align: left;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: inherit;
}

.portfolio-category-item:hover {
    background-color: #f8f9fa;
    border-left-color: #007cba;
}

.portfolio-category-item.active {
    background-color: #007cba;
    color: white;
    border-left-color: #005a87;
}

.portfolio-load-more {
    padding: 12px 20px;
    background-color: transparent;
    color: #007cba;
    border: 1px solid #007cba;
    border-radius: 0;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
    font-size: 14px;
}

.portfolio-load-more:hover {
    background-color: #007cba;
    color: white;
}

.portfolio-load-more:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Content Area Styles */
.portfolio-categories-content {
    flex: 1;
    background-color: transparent;
    border-radius: 0;
    padding: 0;
}

.portfolio-content-inner {
    min-height: 400px;
}

.portfolio-content-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #666;
    font-style: italic;
    background: white;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
}

/* Project Grid */
.portfolio-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* Project Card Design */
.portfolio-project-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.portfolio-project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.portfolio-project-card:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.project-image {
    height: 200px;
    background-color: #f8f9fa;
    overflow: hidden;
    position: relative;
}

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

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

.project-content {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80px;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
    line-height: 1.3;
    width: 100%;
}

/* Single Project View */
.portfolio-single-view {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.portfolio-single-header {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.portfolio-single-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.portfolio-back-button {
    padding: 10px 20px;
    background-color: #08d665;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.portfolio-back-button:hover {
    background-color: #000000;
	color:#fff;
	border:5px solid 08d665;
}

.portfolio-back-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.portfolio-single-content {
    padding: 40px;
}

/* Gallery Layout */
.project-gallery-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.featured-image-section {
    display: flex;
    flex-direction: column;
}

.featured-image-main {
    border-radius: 8px;
    overflow: hidden;
    height: 600px;
}

.featured-image-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-section {
    display: flex;
    flex-direction: column;
}

.gallery-grid-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 600px;
}

.gallery-row {
    display: grid;
    gap: 15px;
}

.gallery-row-top {
    grid-template-columns: 1fr 1fr;
    height: 190px;
}

.gallery-row-middle {
    grid-template-columns: 1fr 1fr;
    height: 190px;
}

.gallery-row-bottom {
    grid-template-columns: 1fr;
    height: 190px;
}

.gallery-row-bottom .single-item {
    width: 100%;
    height: 100%;
}

.gallery-item {
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Project Details Grid */
.project-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    padding: 30px;
    border-radius: 8px;
}

.detail-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Project Description */
.project-description {
    line-height: 1.7;
    color: #555;
    font-size: 16px;
}

.project-description p {
    margin-bottom: 20px;
}

.project-description h2,
.project-description h3,
.project-description h4 {
    margin: 30px 0 15px 0;
    color: #222;
}

.project-description img {
    max-width: 100%;
    height: auto;
}

/* Load More Button */
.portfolio-posts-load-more-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.portfolio-posts-load-more {
    padding: 14px 32px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 15px;
    min-width: 180px;
    text-decoration: none;
    display: inline-block;
}

.portfolio-posts-load-more:hover {
    background-color: #005a87;
}

.portfolio-posts-load-more:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.portfolio-posts-load-more:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.portfolio-posts-load-more.loading {
    position: relative;
    color: transparent;
}

.portfolio-posts-load-more.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Loading States */
.portfolio-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    flex-direction: column;
    gap: 15px;
}

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

.portfolio-single-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    flex-direction: column;
    gap: 15px;
}

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

/* Empty States */
.portfolio-no-items {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #e0e0e0;
}

.portfolio-no-items p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

.portfolio-categories-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.portfolio-categories-empty-state h3 {
    color: #333;
    margin-bottom: 15px;
}

.portfolio-categories-empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Sticky Sidebar */
@media (min-width: 1025px) {
    .portfolio-categories-sidebar {
        position: sticky;
        top: 30px;
        align-self: flex-start;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
}

/* Tablet - 2 columns */
@media (max-width: 1024px) {
    .portfolio-categories-container {
        gap: 30px;
    }
    
    .portfolio-categories-sidebar {
        flex: 0 0 250px;
    }
    
    .portfolio-projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .project-gallery-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-image-main {
        height: 400px;
    }
    
    .gallery-grid-layout {
        height: 400px;
    }
    
    .gallery-row-top,
    .gallery-row-middle,
    .gallery-row-bottom {
        height: 126px;
    }
}

/* Mobile - 1 column */
@media (max-width: 768px) {
    .portfolio-categories-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .portfolio-categories-sidebar {
        flex: none;
        position: static;
        max-height: none;
    }
    
    .portfolio-categories-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 15px;
        gap: 10px;
        scrollbar-width: thin;
    }
    
    .portfolio-categories-list::-webkit-scrollbar {
        height: 4px;
    }
    
    .portfolio-categories-list::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .portfolio-categories-list::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    .portfolio-category-item {
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 160px;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .portfolio-category-item:hover,
    .portfolio-category-item.active {
        border-left: none;
        border-bottom-color: #007cba;
    }
    
    .portfolio-projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .portfolio-single-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .portfolio-single-content {
        padding: 20px;
    }
    
    .featured-image-main {
        height: 300px;
    }
    
    .gallery-grid-layout {
        height: 300px;
    }
    
    .gallery-row-top,
    .gallery-row-middle,
    .gallery-row-bottom {
        height: 95px;
    }
    
    .project-details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .portfolio-projects-grid {
        gap: 15px;
    }
    
    .project-content {
        padding: 15px;
    }
    
    .project-title {
        font-size: 16px;
    }
    
    .featured-image-main {
        height: 250px;
    }
    
    .gallery-grid-layout {
        height: 250px;
    }
    
    .gallery-row-top,
    .gallery-row-middle,
    .gallery-row-bottom {
        height: 78px;
    }
    
    .portfolio-single-content {
        padding: 15px;
    }
    
    .portfolio-single-title {
        font-size: 20px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .portfolio-project-card {
        border: 2px solid;
    }
    
    .portfolio-category-item {
        border: 1px solid;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .portfolio-project-card,
    .portfolio-category-item,
    .portfolio-load-more,
    .portfolio-posts-load-more,
    .portfolio-back-button {
        transition: none;
    }
    
    .portfolio-project-card:hover {
        transform: none;
    }
    
    .portfolio-project-card:hover .project-image img {
        transform: none;
    }
    
    .portfolio-loading-spinner,
    .portfolio-posts-load-more.loading::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .portfolio-categories-sidebar,
    .portfolio-load-more,
    .portfolio-posts-load-more,
    .portfolio-back-button {
        display: none !important;
    }
    
    .portfolio-categories-container {
        display: block;
    }
    
    .portfolio-projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .portfolio-project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}