/* dynamic_grid.css */

.dynamic-grid-wrapper {
    padding-top: 64px;
    padding-bottom: 96px;
}

/* Filter Container */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 32px;
}

.filter-btn {
    padding: 12px 28px;
    border: 1.5px solid #7B5BE4;
    /* Cyberry Purple */
    background-color: transparent;
    color: #7B5BE4;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    /* Matches website buttons */
}

.filter-btn:hover {
    background-color: #7B5BE4;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(123, 91, 228, 0.3);
}

.filter-btn.active {
    background-color: #7B5BE4;
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(123, 91, 228, 0.3);
}

/* Category Description */
.category-description-container {
    margin-bottom: 56px;
    max-width: 900px;
}

.category-desc {
    display: none;
    font-size: 18px;
    line-height: 1.6;
    color: #4B5563;
    /* Gray-600 */
    font-weight: 400;
}

.category-desc.active {
    display: block;
    animation: fadeSlideIn 0.5s ease-out forwards;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    row-gap: 24px;
    align-items: start;
    transition: max-height 1s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

/* Fade-out overlay for collapsed state */
.project-grid.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent, #FFFFFF);
    pointer-events: none;
    z-index: 30;
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Expansion Controls */
.load-more-container {
    display: none; /* Shown via JS if needed */
    justify-content: center;
    padding-top: 48px;
    gap: 16px;
}

.load-more-btn, 
.show-less-btn {
    padding: 16px 40px;
    background-color: #FFFFFF;
    border: 1.5px solid #7B5BE4;
    color: #7B5BE4;
    font-weight: 700;
    font-size: 16px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(123, 91, 228, 0.1);
    display: flex;
    align-items: center;
    justify-content: center; /* Center horizontally within button */
    gap: 12px;
}

.load-more-btn .material-symbols-outlined,
.show-less-btn .material-symbols-outlined {
    font-size: 24px;
    line-height: 1; /* Reset line height for better centering */
    display: block;
    transform: translateY(1px); /* Optical adjustment to match font baseline */
    transition: transform 0.3s ease;
}

.load-more-btn:hover .material-symbols-outlined {
    transform: translateY(3px); /* Combined offset + hover effect */
}

.show-less-btn:hover .material-symbols-outlined {
    transform: translateY(-1px); /* Combined offset + hover effect */
}

.load-more-btn:hover,
.show-less-btn:hover {
    background-color: #7B5BE4;
    color: #FFFFFF;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(123, 91, 228, 0.25);
}

/* Project Card */
.project-card {
    position: relative;
    background-color: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    /* Higher contrast border */
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.06);
    /* Softer shadow */
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-card:hover {
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15);
    /* More pronounced hover shadow */
    transform: translateY(-12px);
    border-color: rgba(123, 91, 228, 0.3);
}

.project-card.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    display: none;
}

/* Staggered offsets for row-first design - reduced values for tighter spacing */
.project-card.stagger-0 { margin-top: 0; }
.project-card.stagger-1 { margin-top: 32px; }
.project-card.stagger-2 { margin-top: 64px; }

/* Card Image Area */
.project-card-image-wrapper {
    flex-grow: 1;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F3F4F6 0%, #FFFFFF 100%);
    /* Subtle gradient for depth */
    position: relative;
    overflow: hidden;
}

.project-card-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 10;
}

.project-card:hover .project-card-image {
    transform: scale(1.1);
}

/* Card Content Area */
.project-card-content {
    padding: 32px 32px 40px 32px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 20;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-title {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #111827;
}

.project-category {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7B5BE4;
    margin: 0;
}

/* Card Icon Box */
.project-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
}

.project-icon .material-symbols-outlined {
    font-size: 22px;
    color: #7B5BE4;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transform: rotate(-45deg);
    /* Points top-right initially */
}

.project-card:hover .project-icon {
    background-color: #7B5BE4;
}

.project-card:hover .project-icon .material-symbols-outlined {
    color: #FFFFFF;
    transform: rotate(0deg) translateX(2px);
    /* Rotates to horizontal on hover */
}

/* Hover Content (Explore Action) */
.project-card-hover-content {
    max-height: 0;
    opacity: 0;
    transition: all 0.4s ease;
    overflow: hidden;
}

.project-card:hover .project-card-hover-content {
    max-height: 50px;
    opacity: 1;
}

.hover-action {
    padding-top: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hover-text {
    font-size: 13px;
    font-weight: 700;
    color: #7B5BE4;
}

.hover-line {
    height: 1.5px;
    flex-grow: 1;
    background-color: rgba(123, 91, 228, 0.15);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}