
/* =============================================
   PORTFOLIO SECTION — FULL REDESIGN
   ============================================= */

/* Prevent body scroll when modal is open */
.modal-open {
    overflow: hidden;
}

/* ===== MODAL OVERLAY ===== */
.portfolio-modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* inset: 0; */
    z-index: 9998;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

/* When shown via JS add class 'is-open' */
.portfolio-modal.is-open {
    display: flex;
    opacity: 1;
}

/* Entry animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== MODAL CARD ===== */
.portfolio-modal .modal-content {
    margin: 100px auto;
    position: relative;
    background: linear-gradient(135deg, #0F172A 0%, #0d1526 100%);
    border: 1px solid rgba(0, 229, 255, 0.18);
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(0, 229, 255, 0.06),
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 50px rgba(0, 229, 255, 0.06);
    animation: modalSlideIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ===== MODAL HEADER ===== */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    gap: 16px;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.modal-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--primary-color, #00E5FF);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}

.modal-label::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary-color, #00E5FF);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--primary-color, #00E5FF);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== CLOSE BUTTON ===== */
.close-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
}

.close-modal:hover {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.35);
    color: var(--primary-color, #00E5FF);
    transform: rotate(90deg);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.2);
}

/* ===== MODAL BODY ===== */
.portfolio-modal .modal-body {
    display: flex;
    gap: 0;
    flex: 1;
    overflow: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.2) transparent;
}

/* ===== IMAGE COLUMN ===== */
.portfolio-modal .modal-image {
    width: 42%;
    padding-left: 20px;
    padding-top: 30px;  
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: #020617;
}

.portfolio-modal .modal-image img {
    width: 100%;
    border-radius: 15px;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.portfolio-modal .modal-image:hover img {
    transform: scale(1.04);
}

/* Gradient overlay on image */
.portfolio-modal .modal-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        transparent 60%,
        #0F172A 100%
    );
    pointer-events: none;
}

/* ===== TEXT COLUMN ===== */
.portfolio-modal .modal-text {
    flex: 1;
    padding: 28px 28px 28px 24px;
 
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.2) transparent;
}

.portfolio-modal .modal-text::-webkit-scrollbar {
    width: 4px;
}

.portfolio-modal .modal-text::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.2);
    border-radius: 4px;
}

/* ===== MODAL TITLE ===== */
.portfolio-modal .modal-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white-color, #fff);
    margin: 0 0 16px;
    line-height: 1.25;
    font-family: var(--font-family, 'Days One', sans-serif);
}

/* Glow accent line under title */
.modal-title-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color, #00E5FF), var(--secondary-color, #00BFA5));
    border-radius: 50px;
    margin-bottom: 18px;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

/* ===== FULL CONTENT ===== */
.portfolio-modal .modal-full-content {
    color: rgba(203, 213, 225, 0.9);
    line-height: 1.75;
    font-size: 0.95rem;
    font-family: var(--text-font, 'Noto Serif', serif);
}

.portfolio-modal .modal-full-content p {
    margin-bottom: 14px;
}

.portfolio-modal .modal-full-content p:last-child {
    margin-bottom: 0;
}

/* ===== MODAL FOOTER (action row) ===== */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    gap: 12px;
}

.modal-close-btn {
    padding: 10px 24px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.modal-close-btn:hover {
    border-color: rgba(0, 229, 255, 0.35);
    color: var(--primary-color, #00E5FF);
    background: rgba(0, 229, 255, 0.06);
}

/* =============================================
   PORTFOLIO SECTION
   ============================================= */
.portfolio-section {
    padding: 80px 0;
    background-color: var(--background-color, #020617);
}

.portfolio-section .section-title {
    text-align: center;
    margin-bottom: 48px;
    font-size: 2.5rem;
    font-family: var(--font-family, 'Days One', sans-serif);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

/* ===== PORTFOLIO CARD ===== */
.portfolio-item {
    background: linear-gradient(145deg, #0F172A, #0d1526);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    display: flex;
    flex-direction: column;
}

.portfolio-item:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 229, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45),
                0 0 30px rgba(0, 229, 255, 0.06);
}

.portfolio-image {
    position: relative;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

/* Image overlay */
.portfolio-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(15, 23, 42, 0.85)
    );
    pointer-events: none;
}

.portfolio-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.portfolio-content h3 {
    margin-bottom: 10px;
    font-size: 1.25rem;
    font-family: var(--font-family, 'Days One', sans-serif);
    color: var(--white-color, #fff);
}

.portfolio-excerpt {
    margin-bottom: 20px;
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.65;
    flex: 1;
}

/* ===== BUTTONS ===== */

a.external-link {
    padding: 10px;
    width: 25px;
    height: 25px;
    font-size: 30px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    align-items: center;
    color: rgba(0, 229, 255, 0.50);
    justify-content: center;
    border-radius: 100px;
    display: inline-flex;
}

.read-more-btn.btn {
    padding: 11px 26px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    border: none;
    font-family: var(--text-font, 'Noto Serif', serif);
}

.btn-primary {
    position: relative;
    background: var(--primary-color, #00E5FF);
    color: #020617;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.25);
}

/* ripple circle */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 40px;
    height: 40px;
    background: var(--secondary-color, #00BFA5);
    border-radius: 50%;
    transform: translate(50%, -50%) scale(0);
    transition: transform 0.6s ease, right 0.6s ease;
    z-index: -1;
}

.btn-primary:hover::after {
    right: 100%;
    transform: translate(50%, -50%) scale(15);
}

.btn-primary:hover {
    color: #fff;
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.4);
}



/* =============================================
RESPONSIVE
============================================= */
@media (max-width:1024px ) and (min-width: 1005px) {
    .portfolio-grid .portfolio-item:last-child {
        display: none;
    }
}
@media (max-width: 768px) {
     .portfolio-modal {
        padding: 0;

    }
    .portfolio-modal .modal-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .portfolio-modal .modal-image {
   width: 100%;
     padding: 0;

        flex-shrink: 0;
    }
        .portfolio-modal .modal-image img{
            border-radius: 0;
        }

    .portfolio-modal .modal-image::after {
        background: linear-gradient(
            to bottom,
            transparent 60%,
            #0F172A 100%
        );
    }

    .portfolio-modal .modal-text {
        padding: 22px 20px;
        overflow-y: visible;
    }

    .portfolio-modal .modal-content {
     width: 90%;
    
        max-height: 92vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 18px 20px 14px;
    }

    .modal-footer {
        padding: 14px 20px;
    }

    .portfolio-modal .modal-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .portfolio-modal {
        padding: 0;
        align-items: flex-end;
    }

    .portfolio-modal .modal-content {
        border-radius: 20px 20px 0 0;
        width: 90%;
        max-height: 92vh;
    }
}