/* Portfolio Section - Simple Two Container Layout */
.portfolio {
    /*height: 100vh;*/
}

.portfolio.expanded {
    display: flex;
}

.portfolio .container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

/* Content Wrapper (Left) */
.portfolio .content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin: 0;
    height: 70%; /* default height */
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamic height based on item count */
.portfolio .content-wrapper.small-grid {
    height: 50%;
}

.portfolio .content-wrapper.large-grid {
    height: 70%;
}

/* Expanded state when project view is active */
.portfolio .content-wrapper.expanded {
    height: 100%;
}

/* Prevent content wrapper from shrinking when portfolio is expanded */
.portfolio.expanded .content-wrapper {
    width: 100%;
    flex: none;
}

/* Details Container (Right) - Smooth slide-in animation */
.details-container {
    width: 0;
    min-width: 0;
    background: var(--glass-bg-secondary);
    backdrop-filter: blur(var(--glass-blur-light));
    -webkit-backdrop-filter: blur(var(--glass-blur-light));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.details-container.active {
    width: 25%;
    padding: 2rem;
    opacity: 1;
}

.project-details {
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.title-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.title-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 255, 136, 0.3);
}

.project-details h3 {
    font-size: 2rem;
    margin-bottom: 0;
    color: var(--primary-color);
    font-weight: 600;
    padding-bottom: 0;
    flex: 1;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-section p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

.detail-section:last-child {
    margin-top: 3rem;
}

.software-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.software-item {
    /* Using utility class for base glassmorphism style */
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.software-item:hover {
    border-color: var(--primary-color);
    background: rgba(26, 26, 26, 0.8);
    transform: var(--hover-transform);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.2);
}

.software-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: contain;
}

.software-icon.fallback {
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--background-primary);
}

.software-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.project-images-grid {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.images-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.images-header h4 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pagination-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pagination-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.3);
}

.pagination-dot.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
    transform: scale(1.3);
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 150px);
    gap: 1rem;
    justify-content: center;
}

.grid-image {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
}

.grid-image:hover {
    opacity: 1;
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.grid-image.active {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
    opacity: 1;
}

.grid-image.video-thumbnail {
    position: relative;
}

.grid-image.video-thumbnail:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 5px 15px rgba(0, 136, 255, 0.3);
}

.grid-image.video-thumbnail.active {
    border-color: var(--accent-blue);
    box-shadow: 0 5px 15px rgba(0, 136, 255, 0.4);
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    position: relative;
}

.section-title h2 {
    font-size: 3rem;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Portfolio Pagination */
.portfolio-pagination {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.portfolio-pagination-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.portfolio-pagination-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.2);
}

.portfolio-pagination-dot.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
    transform: scale(1.2);
}

/* Hide pagination when only one page */
.portfolio-pagination.hidden {
    display: none;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.portfolio-filter-btn {
    padding: 0.8rem 2rem;
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: inherit;
    font-size: 0.9rem;
}

.portfolio-filter-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.portfolio-filter-btn.active {
    background: var(--primary-color);
    color: var(--background-primary);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.content-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 200px);
    gap: 15px;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-content: start;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    padding: 1rem 0;
}

.portfolio-grid.selecting {
    pointer-events: none;
}

.portfolio-grid.hidden {
    opacity: 0;
    transform: translateY(50px);
}

.portfolio-card {
    width: 200px;
    height: 200px;
    /* Using utility class for glassmorphism background */
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--glass-shadow-light);
}

.portfolio-card:hover {
    transform: scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px rgba(0, 255, 136, 0.3);
    z-index: 2;
}

.portfolio-card.selected {
    transform: translateY(-20px) scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 25px 50px rgba(0, 255, 136, 0.4);
    z-index: 10;
}

.portfolio-card.others {
    transform: translateY(15px) scale(0.95);
    opacity: 0;
}

.card-image {
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 255, 136, 0.05), rgba(255, 0, 136, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .card-image::before {
    opacity: 1;
}

.project-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur-light));
    -webkit-backdrop-filter: blur(var(--glass-blur-light));
    border-radius: var(--content-border-radius);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
}

/* Ensure project-view maintains size when portfolio is expanded */
.portfolio.expanded .project-view {
    position: absolute;
    width: 100%;
    height: 100%;
}

.project-view.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.main-display {
    flex: 1;
    position: relative;
}

.main-image {
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    transition: all 0.5s ease;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.main-image video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.back-btn {
    width: 40px;
    height: 40px;
    background: var(--glass-bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 100;
    margin-left: 1rem;
    flex-shrink: 0;
}

.back-btn:hover {
    background: var(--primary-color);
    color: var(--background-primary);
    transform: var(--hover-scale);
}
