/* Stats Hero Section */
.am-stats-hero {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    margin-left: calc(-50vw + 50%);
    padding: 100px 20px;
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 50%, #f0f4ff 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Raleway', sans-serif;
}

/* Header Text */
.am-stats-hero-content {
    max-width: 800px;
    margin-bottom: 50px;
    z-index: 2;
}

.am-stats-hero-title {
    font-family: 'Megante', sans-serif;
    font-size: 3.5rem;
    color: #151516;
    line-height: 1.2;
    margin-bottom: 20px;
}

.am-stats-hero-title span {
    color: #3858E9;
}

.am-stats-hero-subtitle {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 30px;
    font-weight: 400;
}

.am-stats-hero-btn .am-btn {
    height: 60px !important;
    padding: 0 45px !important;
    font-size: 1.1rem;
}

/* Dashboard Card */
.am-stats-dashboard {
    background: #ffffff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(56, 88, 233, 0.08), 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    gap: 20px;
    max-width: 1400px; /* Increased from 1200px to allow more space */
    width: 95%; /* Make it take most of the screen width */
    z-index: 2;
    border: 1px solid rgba(56, 88, 233, 0.05);
    flex-wrap: nowrap; /* Keep cards in one row on desktop */
    justify-content: center;
}

.am-stat-col {
    flex: 1 1 0; /* Distribute space evenly */
    min-width: 250px;
    padding: 25px;
    background: #fafbfc;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f3f8;
}

.am-stat-col:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(56, 88, 233, 0.1);
    background: #ffffff;
}

.am-stat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #8892a0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.am-stat-data-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap; /* allow trend to wrap if very tight */
}

.am-stat-value {
    font-family: 'Megante', sans-serif;
    font-size: 3.8rem;
    color: #151516;
    line-height: 1.1;
    display: flex;
    flex-wrap: wrap; /* allow block suffix to wrap */
    align-items: baseline;
}

.am-inline-suffix {
    font-size: 3.8rem;
    margin-left: 2px;
}

.am-block-suffix {
    display: block;
    width: 100%;
    font-size: 2.8rem;
    font-family: 'Megante', sans-serif;
    line-height: 1;
    margin-top: 5px;
}

.am-stat-trend {
    font-size: 0.85rem;
    font-weight: 700;
    color: #00b67a;
    margin-top: 10px;
    line-height: 1.4;
    white-space: pre-line; 
}
.am-stat-trend.blue {
    color: #3858E9;
}

/* Charts Containers */
.am-chart-box {
    height: 70px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

/* Chart 1: Active Containers (Thick Red Bars) */
.am-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    transition: height 1s ease-out;
}
.am-bar:nth-child(1) { background: #ffd6d6; height: 35%; animation: floatBar 3s infinite alternate 0.1s; }
.am-bar:nth-child(2) { background: #ff7676; height: 40%; animation: floatBar 3s infinite alternate 0.3s; }
.am-bar:nth-child(3) { background: #ff4747; height: 38%; animation: floatBar 3s infinite alternate 0.5s; }
.am-bar:nth-child(4) { background: #ff7676; height: 36%; animation: floatBar 3s infinite alternate 0.7s; }
.am-bar:nth-child(5) { background: #ffd6d6; height: 32%; animation: floatBar 3s infinite alternate 0.9s; }

/* Chart 2: Tonnage (Blue Histogram) */
.am-histogram-box {
    gap: 3px;
    padding-bottom: 5px;
}
.am-hist-bar {
    flex: 1;
    background: #6b8cff;
    border-radius: 2px 2px 0 0;
    animation: histDance 2s ease-in-out infinite alternate;
}
/* Static base heights, animation scales them */
.am-hist-bar:nth-child(1) { height: 20%; }
.am-hist-bar:nth-child(2) { height: 30%; animation-delay: 0.1s; }
.am-hist-bar:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.am-hist-bar:nth-child(4) { height: 60%; animation-delay: 0.3s; }
.am-hist-bar:nth-child(5) { height: 75%; animation-delay: 0.4s; }
.am-hist-bar:nth-child(6) { height: 85%; animation-delay: 0.5s; }
.am-hist-bar:nth-child(7) { height: 65%; animation-delay: 0.6s; }
.am-hist-bar:nth-child(8) { height: 50%; animation-delay: 0.7s; }
.am-hist-bar:nth-child(9) { height: 30%; animation-delay: 0.8s; }
.am-hist-bar:nth-child(10) { height: 40%; animation-delay: 0.9s; }
.am-hist-bar:nth-child(11) { height: 60%; animation-delay: 1.0s; }
.am-hist-bar:nth-child(12) { height: 85%; animation-delay: 1.1s; }
.am-hist-bar:nth-child(13) { height: 70%; animation-delay: 1.2s; }
.am-hist-bar:nth-child(14) { height: 45%; animation-delay: 1.3s; }

/* Chart 3: Partners (Blocks) */
.am-block-box {
    gap: 6px;
    align-items: center;
    height: 40px;
    margin-top: 30px;
}
.am-partner-block {
    flex: 1;
    height: 18px;
    background: #e2e5eb;
    border-radius: 2px;
}
.am-partner-block.highlight {
    background: #a78bfa;
    height: 22px;
    animation: pulseBlock 2s infinite alternate;
}
.am-partner-block.highlight:nth-child(9) { animation-delay: 0.2s; }
.am-partner-block.highlight:nth-child(10) { animation-delay: 0.4s; }

/* Chart 4: Clearance (Wavy Sparkline) */
.am-sparkline-box {
    height: 80px;
    margin-bottom: -15px; /* pull down slightly to hide bottom edge */
    width: 100%;
}
.am-sparkline-box svg {
    animation: waveBreath 3s ease-in-out infinite alternate;
    transform-origin: bottom;
    width: 100%;
    height: 100%;
}
.am-sparkline-fill {
    fill: rgba(255, 71, 71, 0.15); /* Light red background fill */
}
.am-sparkline {
    fill: none;
    stroke: #ff4747;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes floatBar {
    0% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(1.3); transform-origin: bottom; }
}

@keyframes histDance {
    0% { transform: scaleY(0.85); transform-origin: bottom; }
    100% { transform: scaleY(1.15); transform-origin: bottom; }
}

@keyframes pulseBlock {
    0% { opacity: 0.7; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1.05); }
}

@keyframes waveBreath {
    0% { transform: scaleY(0.85) scaleX(1); }
    100% { transform: scaleY(1.15) scaleX(1.05); }
}

/* Mobile Responsiveness */
@media (max-width: 1200px) {
    .am-stats-dashboard {
        flex-wrap: wrap;
    }
    .am-stat-col {
        min-width: calc(50% - 20px); /* 2 columns on tablet */
    }
}

@media (max-width: 768px) {
    .am-stats-hero {
        padding: 60px 15px;
    }
    .am-stats-hero-title {
        font-size: 2.2rem;
    }
    .am-stats-dashboard {
        flex-direction: column;
        padding: 15px;
        width: 100%;
    }
    .am-stat-col {
        min-width: 100%; /* 1 column on mobile */
        padding: 20px;
    }
    /* Scale down numbers so they fit perfectly */
    .am-stat-value {
        font-size: 2.8rem;
    }
    .am-inline-suffix {
        font-size: 2.8rem;
    }
    .am-block-suffix {
        font-size: 2rem;
    }
    /* Adjust trends */
    .am-stat-trend {
        font-size: 0.75rem;
    }
}
