/**
 * Projects Specific Styles
 * Portfolio catalog and project detail pages with slideshow
 */

/* ==================== Container Variations ==================== */
.container-fluid {
    max-width: 100%;
    padding: 0;
}

/* ==================== Projects Catalog ==================== */
.projects-catalog {
    padding: var(--spacing-3xl) 0;
}

.projects-header {
    margin-bottom: var(--spacing-2xl);
    text-align: center;
}

/* Project Filters */
.project-filters {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-3xl);
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.filter-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-btn.active {
    background-color: var(--accent-primary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 var(--spacing-xs);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.filter-btn.active .filter-count {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

.project-catalog-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-base);
}

.project-catalog-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-xl);
}

.project-catalog-link {
    display: block;
    color: inherit;
}

.project-catalog-image {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 600:400 aspect ratio */
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.project-catalog-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.project-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.featured-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    padding: 6px 12px;
    background-color: var(--accent-primary);
    color: var(--text-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    z-index: 1;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(139, 92, 246, 0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.project-catalog-card:hover .project-overlay {
    opacity: 1;
}

.view-project {
    color: white;
    font-weight: 600;
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.project-catalog-content {
    padding: var(--spacing-lg);
}

.project-catalog-categories {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.project-catalog-category {
    padding: 4px 10px;
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--border-radius-sm);
}

.project-catalog-title {
    font-size: var(--text-xl);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.project-catalog-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    font-size: var(--text-sm);
}

.project-catalog-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.tech-badge {
    padding: 4px 10px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.no-projects {
    text-align: center;
    padding: var(--spacing-4xl);
    color: var(--text-secondary);
}

.no-projects svg {
    margin: 0 auto var(--spacing-xl);
    color: var(--text-muted);
}

/* ==================== Project Detail ==================== */
.project-detail {
    padding: var(--spacing-xl) 0;
}

.project-detail-wrapper {
    display: flex;
    flex-direction: column;
}

/* Project Info */
.project-info {
    background-color: var(--bg-primary);
}

.project-info-content {
    padding: 0;
}

.project-header-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--spacing-xl);
    align-items: start;
}

.project-header-left {
    min-width: 0;
}

.project-header-right {
    display: flex;
    justify-content: flex-end;
    padding-top: 0;
}

.project-detail-categories {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.project-detail-category {
    padding: 4px 10px;
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--border-radius-sm);
}

.project-detail-title {
    font-size: var(--text-3xl);
    line-height: 1.2;
}

.project-summary {
    margin-bottom: var(--spacing-lg);
}

.project-summary p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    margin: 0;
}

.project-description {
    color: var(--text-secondary);
    font-size: var(--text-base);
    margin-top: var(--spacing-sm);
}

.project-detail-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.project-detail-section:last-child {
    border-bottom: none;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--text-lg);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.section-heading svg {
    color: var(--accent-primary);
}

.project-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.tech-badge-large {
    padding: 6px 12px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.project-meta-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.meta-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: var(--spacing-sm);
}

.meta-item dt {
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
}

.meta-item dd {
    color: var(--text-primary);
    font-size: var(--text-sm);
    margin: 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--border-radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-archived {
    background-color: rgba(160, 160, 160, 0.2);
    color: var(--text-muted);
}

.project-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.project-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--accent-primary);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
}

.project-link-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.project-link-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.project-link-secondary:hover {
    background-color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* Gallery Section */
.project-gallery {
    background-color: var(--bg-primary);
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: var(--spacing-lg);
    align-items: stretch;
}

.project-gallery:has(.slideshow-thumbnails:empty),
.project-gallery:not(:has(.slideshow-thumbnails)) {
    grid-template-columns: 1fr;
}

.project-description-section {
    margin-bottom: var(--spacing-2xl);
}

/* 3 Column Meta Grid */
.project-meta-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
}

.project-meta-grid .project-detail-section {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

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

.slideshow-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.slide-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    z-index: 10;
    backdrop-filter: blur(4px);
}

.slide-nav:hover {
    background-color: var(--accent-primary);
    transform: translateY(-50%) scale(1.1);
}

.slide-nav svg {
    width: 20px;
    height: 20px;
}

.slide-prev {
    left: var(--spacing-sm);
}

.slide-next {
    right: var(--spacing-sm);
}

.slide-counter {
    position: absolute;
    top: 0;
    right: 0;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: 0 var(--border-radius-lg) 0 var(--border-radius);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.slideshow-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(50, 50, 50, 0.3);
    padding: 6px 12px;
    min-height: auto;
    z-index: 20;
}

.caption-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    color: white;
    font-size: var(--text-sm);
    line-height: 1.6;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin: 0;
    padding: 0;
}

.caption-text.active {
    opacity: 1;
    position: relative;
}

.slideshow-thumbnails-wrapper {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.thumbnail-scroll-btn {
    background-color: var(--accent-primary);
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    border-radius: 0;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 32px;
}

.thumbnail-scroll-btn:first-of-type {
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
}

.thumbnail-scroll-btn:last-of-type {
    border-bottom-left-radius: var(--border-radius-lg);
    border-bottom-right-radius: var(--border-radius-lg);
}

.thumbnail-scroll-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

.thumbnail-scroll-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slideshow-thumbnails {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.slideshow-thumbnails::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    width: 100%;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    background: none;
    padding: 0;
}

.thumbnail:hover {
    border-color: var(--accent-primary);
    transform: scale(1.02);
}

.thumbnail.active {
    border-color: var(--accent-primary);
}

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

.slideshow-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    color: var(--text-muted);
}

.slideshow-empty svg {
    margin-bottom: var(--spacing-lg);
}

/* ==================== Responsive ==================== */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 968px) {
    .project-detail {
        padding: var(--spacing-2xl) 0;
    }

    .project-detail-wrapper {
        gap: var(--spacing-2xl);
    }

    .project-gallery {
        grid-template-columns: 120px 1fr;
        gap: var(--spacing-md);
    }

    .project-meta-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }

    .project-meta-grid .project-detail-section:first-child {
        grid-column: 1 / -1;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    .project-filters {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .projects-catalog {
        padding: var(--spacing-xl) 0;
    }

    .project-detail {
        padding: var(--spacing-xl) 0;
    }

    .project-detail-wrapper {
        gap: var(--spacing-xl);
    }

    .project-header-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .project-header-right {
        justify-content: flex-start;
    }

    .project-detail-categories {
        justify-content: flex-start;
    }

    .project-detail-title {
        font-size: var(--text-2xl);
    }

    .project-meta-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .project-meta-grid .project-detail-section {
        margin-bottom: var(--spacing-lg);
        padding-bottom: var(--spacing-lg);
        border-bottom: 1px solid var(--border-color);
    }

    .project-meta-grid .project-detail-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .project-gallery {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .slideshow-thumbnails-wrapper {
        flex-direction: row;
        order: 2;
        height: auto;
    }

    .thumbnail-scroll-btn {
        padding: 8px;
    }

    .thumbnail-scroll-btn:first-of-type {
        order: 1;
        border-top-right-radius: 0;
        border-bottom-left-radius: var(--border-radius-lg);
    }

    .thumbnail-scroll-btn:last-of-type {
        order: 3;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: var(--border-radius-lg);
        border-top-right-radius: var(--border-radius-lg);
    }

    .slideshow-thumbnails {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        order: 2;
        padding: var(--spacing-sm);
    }

    .gallery-main {
        order: 1;
        height: auto;
    }

    .thumbnail {
        min-width: 80px;
        width: 80px;
    }

    .slide-nav {
        width: 32px;
        height: 32px;
    }

    .slide-prev {
        left: var(--spacing-sm);
    }

    .slide-next {
        right: var(--spacing-sm);
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}
