/* PyPortfolio details — premium layout (aligned with blog details / portfolio listing) */

.portfolio-details-page {
    position: relative;
    overflow-x: clip;
}

.portfolio-details-page::before,
.portfolio-details-page::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.portfolio-details-page::before {
    top: 70px;
    left: -150px;
    background: radial-gradient(circle, rgba(255, 1, 79, 0.55), rgba(255, 1, 79, 0));
}

.portfolio-details-page::after {
    right: -160px;
    bottom: 180px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.45), rgba(37, 99, 235, 0));
}

.portfolio-details-page .container {
    position: relative;
    z-index: 1;
}

.portfolio-details-page .section-title .subtitle {
    color: var(--color-primary);
    font-weight: var(--s-semi-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-details-page .section-title .title {
    font-size: clamp(1.5rem, 3.2vw, 2.35rem);
    font-weight: var(--s-bold);
    color: var(--color-heading-wv) !important;
    letter-spacing: -0.02em;
    line-height: 1.25;
    word-break: break-word;
}

.portfolio-details-page .section-title hr {
    border-color: var(--color-border);
    opacity: 1;
}

/* Carousel hero */
.portfolio-detail-hero {
    position: relative;
    margin: 2rem auto 1.5rem;
    max-width: 960px;
}

.portfolio-detail-hero__shine {
    position: absolute;
    inset: -1px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 1, 79, 0.35), rgba(32, 36, 123, 0.25), rgba(255, 1, 79, 0.2));
    opacity: 0.55;
    filter: blur(12px);
    z-index: 0;
    pointer-events: none;
}

.portfolio-detail-hero__frame {
    position: relative;
    z-index: 1;
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(155deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.portfolio-detail-hero__media {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: linear-gradient(155deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.portfolio-detail-hero__img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

/* Gallery carousel (when multiple images) */
.portfolio-detail-gallery {
    margin: 0 auto 0.5rem;
    padding: 0 1rem;
}

.portfolio-detail-gallery .row {
    margin-bottom: 0;
}

.portfolio-detail-gallery__title {
    margin: 0 0 0.75rem;
    text-align: center;
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    font-weight: var(--s-semi-bold);
    color: var(--color-heading-wv);
}

.portfolio-detail-gallery__frame {
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 0;
    background: var(--gradient-box-w);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-white-3);
    box-sizing: border-box;
}

.portfolio-details-page .portfolio-detail-gallery__frame {
    padding: 16px !important;
}

/* Gallery carousel — fade transition + fixed viewport (Bootstrap 4 compatible) */
.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 14px;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: #0d1119;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__inner {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    border-radius: 14px;
    background: #0d1119;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    transition: opacity 0.65s ease-in-out;
    z-index: 0;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item.active {
    position: relative;
    opacity: 1;
    z-index: 1;
    height: 100%;
    min-height: 100%;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item.active.carousel-item-left,
.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item.active.carousel-item-right {
    opacity: 1;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item.carousel-item-next.carousel-item-left,
.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item.carousel-item-prev.carousel-item-right,
.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item.active.carousel-item-left,
.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item.active.carousel-item-right {
    opacity: 0;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__img,
.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-gallery__img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    box-shadow: none;
    vertical-align: top;
    transform: none !important;
    transition: none;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__indicators {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    z-index: 4;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    list-style: none;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__indicators li {
    position: static;
    top: auto;
    width: 9px;
    height: 9px;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    opacity: 1;
    text-indent: -999px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__indicators li.active {
    background: var(--color-primary);
    transform: scale(1.15);
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control:hover {
    background: rgba(255, 1, 79, 0.85);
    transform: translateY(-50%) scale(1.05);
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control.carousel-control-prev {
    left: 10px;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control.carousel-control-next {
    right: 10px;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
}

.portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control-icon i {
    width: 20px;
    height: 20px;
}

/* Reactions */
.portfolio-detail-reactions-wrap {
    max-width: 100%;
    margin: 0.75rem auto 2rem;
    padding: 0 1rem;
}

.portfolio-detail-reactions {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
}

.portfolio-detail-panel__label {
    margin: 0 0 0.85rem;
    text-align: center;
    font-size: 12px;
    font-weight: var(--s-semi-bold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.portfolio-details-page .pyportfolio-card__reactions-bar {
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0.4rem;
    border-radius: 999px;
    background: var(--gradient-box-w);
    box-shadow: var(--shadow-white-3);
}

.portfolio-details-page .pyportfolio-card__reaction {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-details-page .pyportfolio-card__reaction-divider {
    align-self: center;
    width: 1px;
    height: 28px;
    flex-shrink: 0;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(209, 217, 230, 0.9),
        transparent
    );
}

.portfolio-details-page .pyportfolio-card__reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 50px;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--color-body-white);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: var(--s-semi-bold);
    line-height: 1;
    cursor: pointer;
    text-align: center;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.portfolio-details-page .pyportfolio-card__reaction-btn i {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.25s ease, transform 0.25s ease;
}

.portfolio-details-page .pyportfolio-card__reaction-count {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    min-width: 1ch;
    text-align: center;
}

.portfolio-details-page .pyportfolio-card__reaction-btn--like i {
    color: var(--color-primary);
}

.portfolio-details-page .pyportfolio-card__reaction-btn--like:hover,
.portfolio-details-page .pyportfolio-card__reaction-btn--like:focus-visible {
    background: rgba(255, 1, 79, 0.12);
    color: var(--color-primary);
    outline: none;
}

.portfolio-details-page .pyportfolio-card__reaction-btn--dislike i {
    color: #64748b;
}

.portfolio-details-page .pyportfolio-card__reaction-btn--dislike:hover,
.portfolio-details-page .pyportfolio-card__reaction-btn--dislike:focus-visible {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    outline: none;
}

/* Details grid */
.portfolio-detail-content {
    margin-top: 0.5rem;
    padding: 0 0.5rem 2rem;
    width: 100%;
    max-width: 100%;
}

.portfolio-detail-content__heading {
    margin: 0 0 1.75rem;
    text-align: center;
    font-size: clamp(1.2rem, 2.6vw, 1.55rem);
    font-weight: var(--s-semi-bold);
    color: var(--color-heading-wv);
    letter-spacing: -0.01em;
    padding: 0 0.5rem;
}

.portfolio-detail-grid {
    row-gap: 1.75rem;
    margin-left: 0;
    margin-right: 0;
}

.portfolio-detail-grid > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.portfolio-detail-card {
    height: 100%;
    border-radius: 20px;
    background: var(--gradient-box-w);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-white-3);
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.portfolio-detail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.16);
}

.portfolio-detail-card__header {
    padding: 1.35rem 1.5rem 0.85rem;
    text-align: center;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.portfolio-detail-card__title {
    margin: 0;
    font-size: clamp(2.1rem, 2.2vw, 1.35rem);
    font-weight: var(--s-semi-bold);
    color: var(--color-heading-wv);
    letter-spacing: -0.01em;
}

.portfolio-detail-card__body {
    padding: 1.35rem 1.6rem 1.65rem;
    color: var(--color-body-white);
    font-size: clamp(1rem, 1.8vw, 1.08rem);
    line-height: 1.8;
    word-break: break-word;
    flex: 1 1 auto;
}

.portfolio-detail-card__body--rich {
    padding: 1rem 1.25rem 1.35rem;
    text-align: justify;
    text-justify: inter-word;
}

.portfolio-details-page .portfolio-post-content.blog-post-content {
    width: 100%;
    max-width: 100%;
    text-align: justify !important;
    text-justify: inter-word;
}

.portfolio-details-page .portfolio-post-content.blog-post-content p,
.portfolio-details-page .portfolio-post-content.blog-post-content li {
    text-align: justify;
    text-justify: inter-word;
}

.portfolio-detail-card__body img:not(.portfolio-tech-item__icon):not(.icons_data) {
    max-width: 100%;
    height: auto;
    border-radius: 44px;
    padding: 8px;
}

/* Tech stack */
.portfolio-tech-stack {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.portfolio-tech-group {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.portfolio-tech-group__title {
    margin: 0;
    padding: 1rem 1.15rem;
    text-align: center;
    font-size: clamp(2rem, 2vw, 1.15rem);
    font-weight: var(--s-semi-bold);
    color: var(--color-heading-wv);
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.portfolio-tech-group__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 1.25rem;
    padding: 1.35rem 1.15rem 1.45rem;
}

.portfolio-tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 1rem 0.65rem 0.85rem;
    border-radius: 16px;
    background: var(--gradient-box-w);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-white-3);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.portfolio-tech-item:hover {
    transform: translateY(-5px);
    box-shadow:
        0 12px 28px rgba(255, 1, 79, 0.14),
        var(--shadow-white-3);
}

.portfolio-tech-item__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
    padding: 0.25rem;
}

.portfolio-tech-item__icon-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    flex-shrink: 0;
    padding: 4px;
    border-radius: 18px;
    background: linear-gradient(
        145deg,
        rgba(255, 1, 79, 0.65) 0%,
        rgba(255, 255, 255, 0.92) 45%,
        rgba(255, 1, 79, 0.4) 100%
    );
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.portfolio-tech-item:hover .portfolio-tech-item__icon-frame {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 28px rgba(255, 1, 79, 0.2);
}

.portfolio-details-page .portfolio-tech-item__icon-frame .portfolio-tech-item__icon,
.portfolio-details-page .portfolio-tech-item__icon-frame .icons_data {
    width: 100%;
    height: 100%;
    max-width: none !important;
    max-height: none !important;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 14px;
    box-sizing: border-box;
    object-fit: contain;
    object-position: center;
    display: block;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(155deg, #ffffff 0%, #f1f5f9 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.portfolio-tech-item__name {
    margin: 0;
    font-size: clamp(0.82rem, 1.6vw, 0.95rem);
    line-height: 1.45;
    font-weight: var(--s-medium);
    text-align: center;
    color: var(--color-heading-wv);
    word-break: break-word;
    padding: 0 0.25rem;
}

/* Empty state */
.portfolio-detail-empty {
    margin: 2rem auto;
    max-width: 640px;
    padding: 2.5rem 1.5rem;
    border-radius: 18px;
    background: var(--gradient-box-w);
    box-shadow: var(--shadow-white-3);
    text-align: center;
}

.portfolio-detail-empty h5 {
    margin: 0;
    color: var(--color-body-white);
    font-size: 1.1rem;
    font-weight: var(--s-semi-bold);
}

.portfolio-details-page .pyportfolio-card__reaction-btn.animated {
    animation-duration: 0.8s;
    animation-name: portfolio-detail-bounce;
    animation-iteration-count: infinite;
    transform-origin: center bottom;
}

@keyframes portfolio-detail-bounce {
    0% { transform: translateY(0); }
    20% { transform: translateY(-30px) rotate(-5deg); }
    40% { transform: translateY(0) rotate(5deg); }
    60% { transform: translateY(-15px) rotate(-5deg); }
    80% { transform: translateY(0) rotate(5deg); }
    100% { transform: translateY(0); }
}

@media only screen and (max-width: 991px) {
    .portfolio-detail-grid > .col-lg-6 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .portfolio-tech-group__grid {
        grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
        gap: 1.1rem;
    }
}

@media only screen and (max-width: 767px) {
    .portfolio-detail-hero {
        margin-top: 1.25rem;
    }

    .portfolio-detail-hero__frame {
        padding: 14px;
    }

    .portfolio-details-page .portfolio-detail-gallery__frame {
        padding: 16px !important;
    }

    .portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__viewport {
        aspect-ratio: 16 / 10;
    }

    .portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control {
        width: 36px;
        height: 36px;
    }

    .portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control.carousel-control-prev {
        left: 6px;
    }

    .portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel__control.carousel-control-next {
        right: 6px;
    }

    .portfolio-detail-card__header,
    .portfolio-detail-card__body {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .portfolio-detail-reactions-wrap {
        margin-bottom: 2rem;
    }

    .portfolio-details-page .pyportfolio-card__reactions-bar {
        max-width: 100%;
    }

    .portfolio-tech-group__grid {
        grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
        gap: 1rem;
        padding: 1.1rem 0.85rem 1.2rem;
    }

    .portfolio-tech-item__icon-wrap {
        min-height: 108px;
    }

    .portfolio-tech-item__icon-frame {
        width: 100px;
        height: 100px;
    }
}

@media only screen and (max-width: 575px) {
    .portfolio-detail-reactions-wrap {
        padding: 0 0.65rem;
    }

    .portfolio-details-page .pyportfolio-card__reactions-bar {
        max-width: 100%;
        padding: 0.35rem;
    }

    .portfolio-details-page .pyportfolio-card__reaction-btn {
        min-height: 46px;
        font-size: 13px;
        gap: 0.4rem;
        padding: 0.7rem 0.65rem;
    }

    .portfolio-details-page .pyportfolio-card__reaction-btn i {
        font-size: 15px;
    }

    .portfolio-details-page .pyportfolio-card__reaction-count {
        font-size: 13px;
    }

    .portfolio-detail-grid > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .portfolio-detail-card__body {
        padding: 1.1rem 1rem 1.25rem;
    }

    .portfolio-tech-group__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .portfolio-tech-item {
        padding: 0.9rem 0.55rem 0.8rem;
        gap: 0.65rem;
    }

    .portfolio-tech-item__icon-wrap {
        min-height: 100px;
    }

    .portfolio-tech-item__icon-frame {
        width: 92px;
        height: 92px;
    }

    .portfolio-details-page .portfolio-tech-item__icon-frame .portfolio-tech-item__icon,
    .portfolio-details-page .portfolio-tech-item__icon-frame .icons_data {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-detail-card,
    .portfolio-tech-item,
    .portfolio-details-page .portfolio-detail-hero .carousel-item img,
    .portfolio-details-page .pyportfolio-card__reaction-btn,
    .portfolio-details-page .portfolio-detail-gallery__frame .portfolio-detail-carousel.carousel-fade .portfolio-detail-carousel__item {
        transition: none;
    }

    .portfolio-detail-card:hover,
    .portfolio-tech-item:hover,
    .portfolio-tech-item:hover .portfolio-tech-item__icon-frame {
        transform: none;
    }

    .portfolio-details-page .pyportfolio-card__reaction-btn.animated {
        animation: none;
    }
}
