    .portfolio-card {
        transition: all 0.3s ease;
        background: white;
        border-radius: 1rem;
        overflow: hidden;
    }

    .portfolio-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    }

    .portfolio-image {
        position: relative;
        width: 100%;
        overflow: hidden;
        background: #f8f9fa;
    }

    .portfolio-image::before {
        content: '';
        display: block;
        padding-bottom: 55.56%;
    }

    .portfolio-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        transition: transform 0.5s ease;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

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

    /* Desktop: Buttons in overlay at bottom */
    .portfolio-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.85) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 2;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding-bottom: 2rem;
    }

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

    .portfolio-actions {
        position: relative;
        z-index: 3;
        transform: translateY(30px);
        opacity: 0;
        transition: all 0.4s ease 0.1s;
    }

    .portfolio-card:hover .portfolio-actions {
        transform: translateY(0);
        opacity: 1;
    }

    .btn-icon {
        width: 48px;
        height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        transition: all 0.3s ease;
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* Primary button always colored */
    .btn-icon.btn-primary {
        background: var(--bs-primary, #6366f1) !important;
        color: white !important;
    }

    .btn-icon.btn-primary:hover {
        background: var(--bs-primary-dark, #4f46e5) !important;
        transform: scale(1.1);
    }

    .btn-icon.btn-white {
        background: white;
        color: var(--bs-dark, #111827);
    }

    .btn-icon.btn-white:hover {
        transform: scale(1.1);
        background: var(--bs-light, #f3f4f6);
    }

    .portfolio-tags .badge {
        font-weight: 500;
        padding: 0.35rem 0.75rem;
    }

    .lightbox-image-container {
        max-height: 80vh;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .lightbox-image-container img {
        max-width: 100%;
        max-height: 80vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .lightbox-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* ========== TABLET ========== */
    @media (max-width: 991px) {
        .portfolio-image::before {
            padding-bottom: 65%;
        }

        .lightbox-info {
            min-height: auto !important;
            padding: 2rem !important;
        }
    }

    /* ========== MOBILE: BUTTONS OUTSIDE OVERLAY ========== */
    @media (max-width: 576px) {
        .portfolio-image::before {
            padding-bottom: 85%;
        }

        .portfolio-image img {
            object-fit: contain;
            image-rendering: -webkit-optimize-contrast;
            image-rendering: crisp-edges;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            transform: translateZ(0);
        }

        .portfolio-card:hover .portfolio-image img,
        .portfolio-card:active .portfolio-image img,
        .portfolio-card .portfolio-image img {
            transform: none !important;
        }

        /* MOBILE FIX: No overlay, buttons go below image */
        .portfolio-overlay {
            display: none !important;
        }

        /* Buttons positioned at bottom of card, above info */
        .portfolio-actions {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 10;
            transform: translateY(0) !important;
            opacity: 1 !important;
            background: rgba(0, 0, 0, 0.85);
            padding: 1rem;
            display: flex;
            justify-content: center;
            gap: 1rem;
            border-radius: 0 0 1rem 1rem;
        }

        /* Larger touch targets */
        .btn-icon {
            width: 48px;
            height: 48px;
            min-width: 48px;
            min-height: 48px;
        }

        .btn-icon svg {
            width: 20px;
            height: 20px;
        }

        /* Primary button highly visible on mobile */
        .btn-icon.btn-primary {
            background: var(--bs-primary, #6366f1) !important;
            color: white !important;
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4) !important;
        }

        /* Better spacing */
        .portfolio-info {
            padding: 1rem !important;
            padding-top: 4rem !important;
            /* Space for buttons */
        }

        .portfolio-info h5 {
            font-size: 1rem !important;
            margin-bottom: 0.5rem !important;
        }

        .portfolio-info p {
            font-size: 0.875rem !important;
            line-height: 1.4;
        }

        .portfolio-tags {
            margin-top: 0.75rem !important;
        }

        .portfolio-tags .badge {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
        }

        .portfolio-card {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
            margin-bottom: 1.5rem;
            position: relative;
        }

        .portfolio-card:hover {
            transform: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        }
    }

    /* ========== VERY SMALL SCREENS ========== */
    @media (max-width: 375px) {
        .portfolio-image::before {
            padding-bottom: 95%;
        }

        .btn-icon {
            width: 44px;
            height: 44px;
            min-width: 44px;
            min-height: 44px;
        }

        .btn-icon svg {
            width: 18px;
            height: 18px;
        }
    }

    .portfolio-actions-mobile {
        display: none !important;
        /* Always hidden on desktop */
    }

    @media (max-width: 991px) {
        .portfolio-actions-mobile {
            display: flex !important;
        }
    }

    .portfolio-actions-mobile {
        justify-content: center;
        /* Centers the buttons */
        align-items: center;
        /* Vertical centering */
        gap: 1rem;
        /* Space between buttons */
        margin: 0 !important;
        /* No offset */
    }

    .portfolio-actions-mobile .btn {
        z-index: 999 !important;

    }

    .btn-icon {
        width: 52px;
        height: 52px;
        flex-shrink: 0;
        /* Prevents squishing */
    }

    /* ========== LIGHTBOX MODAL STYLES ========== */

    /* Modal Backdrop */
    .portfolio-lightbox-modal .modal-backdrop {
        backdrop-filter: blur(8px);
        background-color: rgba(0, 0, 0, 0.85);
    }

    /* Custom Close Button */
    .btn-close-custom {
        width: 48px;
        height: 48px;
        background: rgba(0, 0, 0, 0.6);
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        margin: 1.5rem;
        z-index: 1000;
        backdrop-filter: blur(10px);
    }

    .btn-close-custom:hover {
        background: rgba(0, 0, 0, 0.8);
        transform: rotate(90deg);
        border-color: rgba(255, 255, 255, 0.4);
    }

    /* ========== DESKTOP LIGHTBOX ========== */
    .lightbox-container {
        background: white;
        border-radius: 1.5rem;
        overflow: hidden;
        max-width: 1400px;
        margin: 2rem auto;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }

    .lightbox-image-side {
        flex: 1 1 65%;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        min-height: 600px;
    }

    .lightbox-image-wrapper {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .lightbox-main-image {
        max-width: 100%;
        max-height: 80vh;
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 0.5rem;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

    .lightbox-info-side {
        flex: 1 1 35%;
        background: white;
        padding: 3rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: 500px;
    }

    .lightbox-info-content {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .project-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 2rem;
        font-size: 0.875rem;
        font-weight: 600;
        width: fit-content;
    }

    .lightbox-title {
        font-size: 2rem;
        font-weight: 700;
        color: #111827;
        margin: 0;
        line-height: 1.2;
    }

    .lightbox-description {
        font-size: 1rem;
        line-height: 1.6;
        color: #6b7280;
        margin: 0;
    }

    .lightbox-divider {
        height: 2px;
        background: linear-gradient(90deg, #667eea 0%, transparent 100%);
        border-radius: 1px;
    }

    .btn-visit-site {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 1rem 2rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 0.75rem;
        font-size: 1rem;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.3s ease;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }

    .btn-visit-site:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
        color: white;
    }

    .lightbox-footer {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding-top: 1.5rem;
        margin-top: auto;
        border-top: 1px solid #e5e7eb;
        font-size: 0.875rem;
        color: #9ca3af;
    }

    .lightbox-footer strong {
        color: #667eea;
        font-weight: 600;
    }

    /* ========== MOBILE LIGHTBOX ========== */
    .lightbox-container-mobile {
        background: white;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .lightbox-mobile-image {
        background: #000;
        padding: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 50vh;
    }

    .lightbox-mobile-image img {
        max-width: 100%;
        max-height: 50vh;
        object-fit: contain;
        border-radius: 0.5rem;
    }

    .lightbox-mobile-info {
        flex: 1;
        padding: 2rem 1.5rem;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    .project-badge-mobile {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 2rem;
        font-size: 0.875rem;
        font-weight: 600;
        width: fit-content;
    }

    .lightbox-mobile-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: #111827;
        margin: 0;
        line-height: 1.3;
    }

    .lightbox-mobile-description {
        font-size: 0.9375rem;
        line-height: 1.6;
        color: #6b7280;
        margin: 0;
    }

    .btn-visit-site-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 1rem 1.5rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 0.75rem;
        font-size: 1rem;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.3s ease;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
        margin-top: auto;
    }

    .btn-visit-site-mobile:active {
        transform: scale(0.98);
    }

    .lightbox-mobile-footer {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding-top: 1.5rem;
        margin-top: 1rem;
        border-top: 1px solid #e5e7eb;
        font-size: 0.875rem;
        color: #9ca3af;
    }

    .lightbox-mobile-footer strong {
        color: #667eea;
    }

    /* ========== RESPONSIVE ADJUSTMENTS ========== */
    @media (max-width: 991px) {
        .lightbox-info-side {
            padding: 2rem;
        }

        .lightbox-title {
            font-size: 1.75rem;
        }
    }

    @media (max-width: 768px) {
        .btn-close-custom {
            width: 44px;
            height: 44px;
            margin: 1rem;
        }
    }
