.portfolio-section {
    padding: 5rem 2rem;
    position: relative;
}

.portfolio-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    background: rgba(26, 29, 46, 0.6);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid rgba(90, 100, 205, 0.2);
}

.filter-btn:hover {
    background: rgba(90, 105, 205, 0.2);
    color: white;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(67, 93, 178, 0.4);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.portfolio-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.portfolio-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    height: 250px;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 12, 41, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.portfolio-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.portfolio-overlay p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.portfolio-link {
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.portfolio-link:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(67, 82, 178, 0.4);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.1);
}

/* Responsive styles */
@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .portfolio-section {
        padding: 3rem 1rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-image {
        height: 200px;
    }
}


/* Portfolio Modal */
.portfolio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--darker-bg);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid rgba(90, 109, 205, 0.3);
    animation: slideUp 0.4s ease-out;
    position: relative;
}

.modal-image {
    height: 100%;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-text {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.modal-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: white;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-details {
    margin-bottom: 2rem;
}

.modal-details p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.modal-details strong {
    color: var(--secondary-color);
}

.modal-button {
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: auto;
    align-self: flex-start;
}

.modal-button:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(67, 89, 178, 0.4);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: color 0.3s;
    background: none;
    border: none;
    z-index: 10;
}

.close-modal:hover {
    color: var(--secondary-color);
}

@keyframes slideUp {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-image {
        height: 200px;
    }
}