/* ================================================================
   PORTFOLIO SECTION - PUIUX Landing Page
   Premium Design with Awwwards-level Quality
   ================================================================ */

/* ===============================================
   Section Container
   =============================================== */
.portfolio-section {
    position: relative;
    padding: 6rem 0;
    background: #000000;
    overflow: hidden;
}

/* Animated Background */
.portfolio-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(37, 211, 102, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(18, 140, 126, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.portfolio-section .container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===============================================
   Section Header
   =============================================== */
.portfolio-section__header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.portfolio-section__subtitle {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #25D366;
    margin-bottom: 1rem;
    padding: 0.5rem 1.5rem;
    background: rgba(37, 211, 102, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.portfolio-section__title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portfolio-section__description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    max-width: 700px;
    margin: 0 auto;
}

/* ===============================================
   Filter Tabs
   =============================================== */
.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.filter-btn {
    padding: 0.75rem 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 211, 102, 0.2), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover {
    color: #25D366;
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.1);
    transform: translateY(-2px);
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn.active {
    color: #000000;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-color: #25D366;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.filter-btn.active::before {
    display: none;
}

/* ===============================================
   Portfolio Grid
   =============================================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

/* ===============================================
   Portfolio Card
   =============================================== */
.portfolio-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.portfolio-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
}

.portfolio-card:hover {
    transform: translateY(-12px);
    border-color: rgba(37, 211, 102, 0.3);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 50px rgba(37, 211, 102, 0.2);
}

.portfolio-card:hover::before {
    opacity: 0.15;
}

/* ===============================================
   Card Image Container
   =============================================== */
.portfolio-card__image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(18, 140, 126, 0.1));
}

.portfolio-card__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 2;
}

.portfolio-card:hover .portfolio-card__image::before {
    opacity: 1;
}

.portfolio-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card:hover .portfolio-card__image img {
    transform: scale(1.1);
}

/* ===============================================
   Card Category Badge
   =============================================== */
.portfolio-card__category {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 3;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
    background: #25D366;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
}

.portfolio-card:hover .portfolio-card__category {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* ===============================================
   Card Content
   =============================================== */
.portfolio-card__content {
    padding: 2rem;
}

.portfolio-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.portfolio-card:hover .portfolio-card__title {
    color: #25D366;
}

.portfolio-card__description {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1.5rem;
}

/* ===============================================
   Card Tags
   =============================================== */
.portfolio-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.portfolio-tag {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.portfolio-card:hover .portfolio-tag {
    color: #25D366;
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.1);
}

/* ===============================================
   Card View Button
   =============================================== */
.portfolio-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #25D366;
    text-decoration: none;
    transition: all 0.3s ease;
}

.portfolio-card__arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-card__link {
    gap: 0.75rem;
}

.portfolio-card:hover .portfolio-card__arrow {
    transform: translateX(-4px);
}

/* ===============================================
   View All Button
   =============================================== */
.portfolio-cta {
    text-align: center;
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.portfolio-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #000000;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    position: relative;
    overflow: hidden;
}

.portfolio-cta__btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.portfolio-cta__btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
}

.portfolio-cta__btn:hover::before {
    left: 100%;
}

.portfolio-cta__btn svg {
    transition: transform 0.3s ease;
}

.portfolio-cta__btn:hover svg {
    transform: translateX(-4px);
}

/* ===============================================
   Filter Animation States
   =============================================== */
.portfolio-card.hide {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.portfolio-card.show {
    animation: fadeInScale 0.6s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===============================================
   Animations
   =============================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================================
   RESPONSIVE - TABLET (768px - 1023px)
   =============================================== */
@media screen and (min-width: 768px) {
    .portfolio-section {
        padding: 5rem 0;
    }

    .portfolio-section__title {
        font-size: 3rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    .portfolio-card__image {
        height: 320px;
    }

    .portfolio-filters {
        gap: 1.25rem;
    }
}

/* ===============================================
   RESPONSIVE - DESKTOP (1024px+)
   =============================================== */
@media screen and (min-width: 1024px) {
    .portfolio-section {
        padding: 6rem 0;
    }

    .portfolio-section__title {
        font-size: 3.5rem;
    }

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

    .portfolio-card__image {
        height: 350px;
    }

    .portfolio-card__content {
        padding: 2.5rem;
    }

    .portfolio-card__title {
        font-size: 1.625rem;
    }
}

/* ===============================================
   Accessibility
   =============================================== */
@media (prefers-reduced-motion: reduce) {
    .portfolio-card,
    .portfolio-card__image img,
    .filter-btn,
    .portfolio-cta__btn,
    .portfolio-section__header,
    .portfolio-filters,
    .portfolio-grid,
    .portfolio-cta,
    .portfolio-card.show {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus Styles for Keyboard Navigation */
.portfolio-card:focus,
.filter-btn:focus,
.portfolio-cta__btn:focus {
    outline: 2px solid #25D366;
    outline-offset: 4px;
}

/* RTL Support */
[dir="rtl"] .portfolio-card__arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .portfolio-card:hover .portfolio-card__arrow {
    transform: translateX(4px) scaleX(-1);
}

[dir="rtl"] .portfolio-cta__btn:hover svg {
    transform: translateX(4px);
}
