/* Portfolio Section */
#portfolio {
    background: var(--card-bg);
    padding: var(--section-padding);
}

.portfolio-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    margin-top: -30px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.portfolio-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    aspect-ratio: 16 / 10;
    /* Widescreen aspect ratio */
    background: #111;
    /* Add a background for letterboxing */
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 77, 109, 0.2);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensures the whole image is visible */
    display: block;
    transition: var(--transition);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top,
            rgba(10, 10, 10, 0.95) 0%,
            rgba(10, 10, 10, 0.8) 50%,
            rgba(10, 10, 10, 0.4) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 24px;
    opacity: 0;
    transition: all 0.4s ease;
    box-sizing: border-box;
    overflow-y: auto;
    height: 100%;
    width: 100%;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay h3 {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 16px;
    width: 100%;
    text-align: center;
    word-break: break-word;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    background: rgba(16, 185, 129, 0.12);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 2;
    transform: none;
    transition: none;
}

.portfolio-overlay p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    word-break: break-word;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.portfolio-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 15px;
    margin-bottom: 8px;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay p,
.portfolio-item:hover .portfolio-links {
    transform: translateY(0);
}

.portfolio-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(16, 185, 129, 0.08);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
    border: 2px solid rgba(16, 185, 129, 0.1);
}

.portfolio-link:hover {
    transform: translateY(-3px);
    background: var(--primary-color);
    box-shadow: 0 6px 15px rgba(255, 77, 109, 0.3);
    border-color: rgba(255, 77, 109, 0.2);
}

.portfolio-link i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
    transition: transform 0.3s ease;
}

.portfolio-link:hover i {
    transform: translate(-50%, -50%) scale(1.1);
}

.portfolio-cta {
    text-align: center;
    margin-top: 50px;
}

/* Portfolio Link Styles */
.portfolio-link {
    display: inline-block;
    padding: 12px 30px;
    background: var(--gradient);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    margin-top: 20px;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

.portfolio-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}