/**
 * Features Page Elegant/Premium Redesign
 * Leverages refined design: glassmorphism, geometric precision, elegant typography, subtle gradients
 */

/* ============================================
   HERO SECTION
   ============================================ */

.hero-features {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0A5FAD 0%, #084D8A 50%, #063D6E 100%);
}

/* Gradient mesh background */
.mesh-gradient-bg {
    position: relative;
}

.mesh-gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(251, 173, 72, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Glassmorphic hero card */
.hero-card {
    max-width: 900px;
    padding: var(--space-16);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}

/* Floating badge */
.badge-float {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(135deg, #FBAD48, #E99A30);
    color: white;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(251, 173, 72, 0.3);
    margin-bottom: var(--space-4);
    animation: elegant-pulse 3s ease-in-out infinite;
}

@keyframes elegant-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(251, 173, 72, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 24px rgba(251, 173, 72, 0.4);
    }
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero title - kinetic typography */
.hero-title {
    font-size: var(--text-7xl-fluid);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-6);
}

.hero-subtitle {
    font-size: var(--text-xl);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: var(--space-8);
}

/* Feature orbit container */
.feature-orbit {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#orbit-canvas {
    max-width: 100%;
    height: 100%;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-arrow {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    position: relative;
    animation: scroll-bounce 2s infinite;
}

.scroll-arrow::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: scroll-dot 2s infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes scroll-dot {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* Pulse animation for CTAs */
.pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(10, 95, 173, 0.4); }
    50% { box-shadow: 0 0 30px rgba(10, 95, 173, 0.6), 0 0 40px rgba(251, 173, 72, 0.3); }
}

/* Elegant fade-in animation */
@keyframes elegant-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Elegant gradient shift for stat numbers */
@keyframes elegant-gradient-shift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* ============================================
   CATEGORY TABS NAVIGATION
   ============================================ */

.category-tabs {
    position: sticky;
    top: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    z-index: 100;
    padding: var(--space-4) 0;
}

.tabs-wrapper {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--duration-moderate) var(--ease-default);
    position: relative;
}

.tab-item:hover {
    background: rgba(10, 95, 173, 0.05);
}

.tab-item.active {
    background: rgba(10, 95, 173, 0.1);
}

.tab-icon {
    font-size: 1.5rem;
}

.tab-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--p4-grey-700);
    text-align: center;
    white-space: nowrap;
}

.tab-item.active .tab-label {
    color: var(--p4-blue);
}

.tab-count {
    display: inline-block;
    margin-left: var(--space-1);
    padding: 2px 6px;
    background: var(--p4-orange);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Active indicator (gradient underline) */
.tab-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--p4-blue), var(--p4-orange));
    border-radius: 3px 3px 0 0;
    transition: width var(--duration-moderate) var(--ease-default);
}

.tab-item.active .tab-indicator {
    width: 80%;
}

/* ============================================
   BENTO GRID LAYOUT
   ============================================ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-6);
    padding: var(--space-12) 0;
}

@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card size variations */
.feature-card.wide {
    grid-column: span 2;
}

.feature-card.tall {
    grid-row: span 2;
}

@media (max-width: 767px) {
    .feature-card.wide,
    .feature-card.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* ============================================
   FEATURE CARDS (3 LAYERS)
   ============================================ */

/* Layer 1: Collapsed Card */
.feature-card {
    background: white;
    border-radius: 16px;
    padding: var(--space-8);
    box-shadow: 0 2px 8px rgba(10, 95, 173, 0.06);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid #E8E9EA;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0A5FAD, #FBAD48);
    transform: scaleX(0);
    transition: transform 300ms ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(10, 95, 173, 0.16);
    border-color: rgba(10, 95, 173, 0.3);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

/* Feature icon wrapper */
.feature-icon-wrapper {
    position: relative;
    width: fit-content;
    margin-bottom: var(--space-6);
}

.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(10, 95, 173, 0.1), rgba(251, 173, 72, 0.05));
    font-size: 2.5rem;
    transition: transform 300ms ease;
    position: relative;
}

.feature-icon::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, #0A5FAD, #FBAD48);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 300ms;
}

.feature-card:hover .feature-icon {
    transform: scale(1.05);
}

.feature-card:hover .feature-icon::before {
    opacity: 1;
}

/* NEW badge */
.new-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 4px 10px;
    background: var(--p4-orange);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(251, 173, 72, 0.4);
}

/* Feature title */
.feature-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--p4-blue-700);
    margin-bottom: var(--space-3);
    line-height: 1.3;
}

/* Feature summary */
.feature-summary {
    font-size: var(--text-base);
    color: var(--p4-grey-600);
    line-height: 1.6;
    margin-bottom: var(--space-4);
}

/* Key stat */
.feature-stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    background: linear-gradient(135deg, rgba(10, 95, 173, 0.05), rgba(251, 173, 72, 0.05));
    border-radius: 12px;
    margin-bottom: var(--space-4);
}

.stat-number {
    font-size: var(--text-4xl);
    font-weight: 700;
    background: linear-gradient(90deg, #0A5FAD 0%, #FBAD48 50%, #0A5FAD 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: elegant-gradient-shift 3s ease infinite;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--p4-grey-600);
    font-weight: 500;
}

/* Layer 2: Expanded Content */
.feature-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all var(--duration-slow) var(--ease-default);
}

.feature-card.expanded .feature-details {
    max-height: 1000px;
    opacity: 1;
    margin-top: var(--space-6);
}

/* Capabilities grid */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.capability-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: rgba(10, 95, 173, 0.05);
    border-radius: 8px;
    font-size: var(--text-sm);
    color: var(--p4-grey-700);
}

.capability-item i {
    color: var(--p4-blue);
}

/* Process preview */
.process-preview {
    margin-bottom: var(--space-6);
}

.process-preview h5 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--p4-blue-700);
    margin-bottom: var(--space-3);
}

.process-steps-mini {
    display: flex;
    gap: var(--space-2);
}

.step {
    flex: 1;
    padding: var(--space-3);
    background: white;
    border: 2px solid var(--p4-blue-200);
    border-radius: 8px;
    text-align: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--p4-blue);
}

/* ============================================
   FEATURE DETAIL MODAL (Layer 3)
   ============================================ */

.feature-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-6);
}

.feature-modal.active {
    display: flex;
    animation: modal-fade-in var(--duration-slow) var(--ease-out);
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
    animation: modal-scale-in var(--duration-slow) var(--ease-out);
    transform-origin: center;
}

@keyframes modal-scale-in {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    border-bottom: 1px solid var(--p4-grey-200);
}

.modal-header h2 {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--p4-blue-700);
}

.btn-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--p4-grey-100);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--p4-grey-600);
    cursor: pointer;
    transition: all var(--duration-normal);
}

.btn-close:hover {
    background: var(--p4-grey-200);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
}

.modal-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    border-bottom: 2px solid var(--p4-grey-200);
    overflow-x: auto;
}

.modal-tabs button {
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 600;
    color: var(--p4-grey-600);
    cursor: pointer;
    transition: all var(--duration-normal);
    white-space: nowrap;
}

.modal-tabs button.active {
    color: var(--p4-blue);
    border-bottom-color: var(--p4-blue);
}

.modal-tabs button:hover {
    color: var(--p4-blue-600);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    border-top: 1px solid var(--p4-grey-200);
    gap: var(--space-4);
}

/* ============================================
   3PL CLIENT PORTAL - HERO TREATMENT
   ============================================ */

.feature-showcase {
    padding: var(--space-20) 0;
    position: relative;
    overflow: hidden;
}

.showcase-badge {
    margin-bottom: var(--space-6);
}

.badge-glow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, var(--p4-blue), var(--p4-orange));
    color: white;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 4px 30px rgba(10, 95, 173, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.metric {
    text-align: center;
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.metric-number {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--p4-orange);
    display: block;
    margin-bottom: var(--space-2);
}

.metric-label {
    font-size: var(--text-sm);
    color: var(--p4-grey-700);
}

/* Device mockup */
.device-mockup {
    position: relative;
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.device-mockup img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ============================================
   CATEGORY SECTIONS
   ============================================ */

.category-section {
    padding: var(--space-16) 0;
    position: relative;
}

.category-section:nth-child(even) {
    background: linear-gradient(135deg, rgba(10, 95, 173, 0.02), rgba(251, 173, 72, 0.02));
}

.category-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.category-title {
    font-size: var(--text-5xl-fluid);
    font-weight: 700;
    background: linear-gradient(135deg, var(--p4-blue), var(--p4-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-3);
}

.category-subtitle {
    font-size: var(--text-lg);
    color: var(--p4-grey-600);
    max-width: 700px;
    margin: 0 auto;
}

/* Curved section dividers */
.section-curve {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.section-curve svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.section-curve .shape-fill {
    fill: #FFFFFF;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .hero-features {
        min-height: 75vh;
    }

    .hero-card {
        padding: var(--space-8);
    }

    .hero-title {
        font-size: var(--text-4xl);
    }

    .feature-orbit {
        height: 200px;
    }

    .category-tabs {
        top: 60px;
    }

    .tabs-wrapper {
        justify-content: flex-start;
    }

    .tab-item {
        padding: var(--space-2) var(--space-4);
    }

    .feature-card {
        padding: var(--space-6);
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    /* Disable glassmorphism on mobile for performance */
    .glass-effect,
    .hero-card,
    .category-tabs {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Simpler animations on mobile */
    .feature-card:hover {
        transform: none;
    }

    .blob-shape {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
