/**
 * Portfolio Enhanced Styles
 * Phase 33-01: Score badges, tier badges, and filter controls
 */

/* ==========================================================================
   Score Badge - Circular with number
   ========================================================================== */

.score-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.score-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.score-badge__number {
    display: block;
}

.score-badge__tier {
    display: none; /* Hide tier inside badge, show separately */
}

/* Score colour coding */
.score-badge--green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.score-badge--yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
}

.score-badge--grey {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: #ffffff;
}

/* ==========================================================================
   Tier Badge - Pill shape
   ========================================================================== */

.tier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease;
}

.tier-badge:hover {
    transform: scale(1.05);
}

/* Tier colour coding */
.tier-badge--grey {
    background-color: #e5e7eb;
    color: #4b5563;
}

.tier-badge--blue {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.tier-badge--gold {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* ==========================================================================
   Portfolio Score/Tier Container
   ========================================================================== */

.portfolio-score-tier {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

/* ==========================================================================
   Enhanced Filter Controls
   ========================================================================== */

.portfolio-enhanced-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.portfolio-enhanced-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portfolio-enhanced-filters .filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portfolio-enhanced-filters select,
.portfolio-enhanced-filters input[type="range"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #ffffff;
    min-width: 150px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portfolio-enhanced-filters select:focus,
.portfolio-enhanced-filters input[type="range"]:focus {
    outline: none;
    border-color: #ffbb09;
    box-shadow: 0 0 0 3px rgba(255, 187, 9, 0.1);
}

.portfolio-enhanced-filters .score-slider-group {
    min-width: 200px;
}

.portfolio-enhanced-filters .score-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portfolio-enhanced-filters input[type="range"] {
    flex: 1;
    padding: 0;
    cursor: pointer;
}

.portfolio-enhanced-filters .score-value {
    min-width: 32px;
    text-align: center;
    font-weight: 600;
    color: #374151;
}

.portfolio-enhanced-filters .filter-reset {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.portfolio-enhanced-filters .filter-reset:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Filter results counter */
.portfolio-filter-count {
    font-size: 14px;
    color: #6b7280;
    margin-left: auto;
}

.portfolio-filter-count strong {
    color: #111827;
}

/* Grid loading state — dims cards so the user can see the AJAX fetch happening */
#portfolio-container {
    transition: opacity 0.2s ease;
}

#portfolio-container.is-filtering {
    opacity: 0.35;
    pointer-events: none;
}

/* ==========================================================================
   Portfolio Card Enhancements
   ========================================================================== */

/* Card hiding animation for filtering */
.portfolio-item.hidden-by-filter {
    display: none !important;
}

.portfolio-item.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.portfolio-item.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Score section in card footer */
.portfolio-score-section {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #e5e7eb;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .portfolio-enhanced-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .portfolio-enhanced-filters .filter-group {
        width: 100%;
    }

    .portfolio-enhanced-filters select {
        width: 100%;
    }

    .portfolio-enhanced-filters .score-slider-group {
        width: 100%;
    }

    .portfolio-filter-count {
        margin-left: 0;
        margin-top: 8px;
        text-align: center;
    }

    .portfolio-score-tier {
        margin-left: 0;
        margin-top: 8px;
    }

    .portfolio-score-section {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 8px;
    }

    .score-badge {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

/* ==========================================================================
   No Results State
   ========================================================================== */

.portfolio-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.portfolio-no-results h4 {
    font-size: 18px;
    color: #374151;
    margin-bottom: 8px;
}

.portfolio-no-results p {
    font-size: 14px;
    margin-bottom: 16px;
}

.portfolio-no-results button {
    padding: 8px 16px;
    background: #ffbb09;
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.portfolio-no-results button:hover {
    background: #e5a708;
}

/* ==========================================================================
   Netflix Hero Carousel - Portfolio Page
   ========================================================================== */

.ddna-portfolio-hero-showcase {
    background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 50%, #0f3460 100%) !important;
    padding: 48px 0 56px;
    margin-bottom: 32px;
}

/* Ensure dark background overrides any parent styles */
.ddna-portfolio-hero-showcase,
.ddna-portfolio-hero-showcase .container,
.ddna-portfolio-hero-showcase .ddna-section-header {
    background-color: transparent !important;
}

.ddna-portfolio-hero-showcase .ddna-section-header {
    text-align: center;
    margin-bottom: 32px;
}

.ddna-portfolio-hero-showcase .ddna-section-header h2 {
    color: #ffffff;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ddna-portfolio-hero-showcase .ddna-section-header h2 span {
    color: #ffbb09;
    text-shadow: 0 2px 8px rgba(255, 187, 9, 0.3);
}

.ddna-portfolio-hero-showcase .ddna-section-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.ddna-portfolio-hero-showcase .ddna-hero-row {
    margin-bottom: 0;
}

.ddna-portfolio-hero-showcase .ddna-category-swiper {
    padding: 10px 0;
}

/* Make cards slightly larger in hero */
.ddna-portfolio-hero-showcase .ddna-portfolio-card {
    transform: scale(1);
    transition: transform 0.3s ease;
}

.ddna-portfolio-hero-showcase .ddna-portfolio-card:hover {
    transform: scale(1.05);
}

/* Navigation arrows styling */
.ddna-portfolio-hero-showcase .swiper-button-prev,
.ddna-portfolio-hero-showcase .swiper-button-next {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.ddna-portfolio-hero-showcase .swiper-button-prev:hover,
.ddna-portfolio-hero-showcase .swiper-button-next:hover {
    background: rgba(255, 187, 9, 0.3);
}

.ddna-portfolio-hero-showcase .swiper-button-prev::after,
.ddna-portfolio-hero-showcase .swiper-button-next::after {
    font-size: 18px;
}

@media (max-width: 768px) {
    .ddna-portfolio-hero-showcase {
        padding: 32px 0 40px;
    }

    .ddna-portfolio-hero-showcase .ddna-section-header h2 {
        font-size: 24px;
    }

    .ddna-portfolio-hero-showcase .ddna-section-header p {
        font-size: 14px;
    }

    .ddna-portfolio-hero-showcase .swiper-button-prev,
    .ddna-portfolio-hero-showcase .swiper-button-next {
        display: none;
    }
}

/* ==========================================================================
   Premium Hero Section - Portfolio Showcase (Legacy - kept for reference)
   ========================================================================== */

.portfolio-hero-premium {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    padding: 48px 24px 56px;
    border-radius: 12px 12px 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
}

/* Subtle pattern overlay */
.portfolio-hero-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(255, 187, 9, 0.1) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(255, 187, 9, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.portfolio-hero__title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    position: relative;
    z-index: 1;
}

.portfolio-hero__subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 32px 0;
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Stats Row
   ========================================================================== */

.portfolio-stats-row {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.portfolio-stat-item {
    text-align: center;
}

.portfolio-stat-item__number {
    display: block;
    font-size: 42px;
    font-weight: 800;
    color: #ffbb09;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.portfolio-stat-item__label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ==========================================================================
   Top Portfolios Podium
   ========================================================================== */

.portfolio-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.portfolio-podium__place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px 16px 16px;
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.portfolio-podium__place:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.1);
}

/* Place-specific styling */
.portfolio-podium__place--1 {
    order: 2;
    padding-bottom: 32px;
    min-width: 140px;
}

.portfolio-podium__place--2 {
    order: 1;
    min-width: 120px;
}

.portfolio-podium__place--3 {
    order: 3;
    min-width: 120px;
}

/* Podium avatars */
.portfolio-podium__avatar-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.portfolio-podium__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.portfolio-podium__place--1 .portfolio-podium__avatar {
    width: 80px;
    height: 80px;
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.portfolio-podium__place--2 .portfolio-podium__avatar {
    border-color: #C0C0C0;
    box-shadow: 0 0 16px rgba(192, 192, 192, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.portfolio-podium__place--3 .portfolio-podium__avatar {
    border-color: #CD7F32;
    box-shadow: 0 0 16px rgba(205, 127, 50, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Score badge on podium */
.portfolio-podium__score-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.portfolio-podium__place--1 .portfolio-podium__score-badge {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.portfolio-podium__name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-podium__tool {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CTA button */
.portfolio-hero__cta {
    position: relative;
    z-index: 1;
}

.portfolio-hero__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #ffbb09;
    color: #1f2937;
    font-weight: 700;
    font-size: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.portfolio-hero__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 187, 9, 0.3);
    color: #1f2937;
}

/* ==========================================================================
   Responsive - Hero
   ========================================================================== */

@media (max-width: 768px) {
    .portfolio-hero-premium {
        padding: 32px 16px 40px;
    }

    .portfolio-hero__title {
        font-size: 24px;
    }

    .portfolio-hero__subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .portfolio-stats-row {
        gap: 24px;
        flex-wrap: wrap;
    }

    .portfolio-stat-item__number {
        font-size: 32px;
    }

    .portfolio-stat-item__label {
        font-size: 11px;
    }

    .portfolio-podium {
        gap: 8px;
    }

    .portfolio-podium__place {
        padding: 12px 10px 12px;
        min-width: auto !important;
    }

    .portfolio-podium__place--1 {
        padding-bottom: 20px;
    }

    .portfolio-podium__avatar {
        width: 48px;
        height: 48px;
    }

    .portfolio-podium__place--1 .portfolio-podium__avatar {
        width: 56px;
        height: 56px;
    }

    .portfolio-podium__score-badge {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .portfolio-podium__place--1 .portfolio-podium__score-badge {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .portfolio-podium__name {
        font-size: 12px;
        max-width: 70px;
    }
}

@media (max-width: 480px) {
    .portfolio-stats-row {
        gap: 16px;
    }

    .portfolio-stat-item__number {
        font-size: 28px;
    }

    .portfolio-podium__place {
        padding: 10px 8px 10px;
    }

    .portfolio-podium__avatar {
        width: 40px;
        height: 40px;
    }

    .portfolio-podium__place--1 .portfolio-podium__avatar {
        width: 48px;
        height: 48px;
    }
}

/* ==========================================================================
   Portfolio image placeholder — shown when no featured image is set.
   Matches .portfolio-image dimensions (220px height, full width, same radius).
   ========================================================================== */

.portfolio-image__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1c1c2e 0%, #2a2a42 100%);
    color: #ffbb09;
    border-radius: 10px 10px 0 0;
}
