/* ==========================================================================
   KPI Hero Bar - Overview Pages Component Styles
   Used by ClientOverview and ManagerOverview pages
   Industrial Command Center aesthetic with performance metrics
   ========================================================================== */

/* Page Load Animation */
@keyframes kpiSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-hero-bar {
    display: flex;
    width: 100%;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(51, 65, 85, 0.7));
    border: 1px solid rgba(100, 116, 139, 0.25);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: kpiSlideIn 0.4s ease-out both;
}

.kpi-cards-row {
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
    width: 100%;
    align-items: stretch;
}

/* ==========================================================================
   Welcome Card - Brand/Company Card
   ========================================================================== */
.welcome-card {
    flex: 1.5;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg,
        rgba(0, 153, 0, 0.2) 0%,
        rgba(0, 120, 0, 0.15) 50%,
        rgba(255, 204, 0, 0.1) 100%);
    border: 1px solid rgba(0, 153, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: kpiSlideIn 0.4s ease-out 0.05s both;
}

/* Subtle corner accent - hidden by default, shown in basic variant */
.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    display: none;
}

.welcome-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 153, 0, 0.25);
    border-color: rgba(0, 153, 0, 0.6);
}

.welcome-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.welcome-brand-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.welcome-company-name {
    font-family: 'Montserrat', -apple-system, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.welcome-brand-text {
    font-family: 'Montserrat', -apple-system, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #00cc00 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
}

.welcome-period {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    position: relative;
    z-index: 1;
    margin-top: 0.25rem;
}

/* Basic Welcome Card (no branding configured) */
.welcome-card-basic {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.15) 0%,
        rgba(37, 99, 235, 0.1) 50%,
        rgba(99, 102, 241, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.welcome-card-basic .welcome-company-name {
    color: #93c5fd;
}

.welcome-card-basic .welcome-brand-text {
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-card-basic .welcome-subtitle {
    color: rgba(147, 197, 253, 0.7);
}

.welcome-card-basic .welcome-period {
    color: rgba(96, 165, 250, 0.7);
}

.welcome-card-basic:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
}

/* Branded Welcome Card (with client colors - styles set via inline style) */
.welcome-card-branded {
    /* Base styles inherited from .welcome-card */
    /* Background and border colors set via inline style */
}

.welcome-card-branded .welcome-company-name {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.welcome-card-branded .welcome-subtitle {
    color: rgba(255, 255, 255, 0.75);
}

.welcome-card-branded .welcome-brand-text {
    /* Colors set via inline style */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-card-branded::before {
    /* Remove the hardcoded accent strip for branded cards */
    display: none;
}

/* Logo styling for branded cards */
.welcome-logo {
    height: 72px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ==========================================================================
   KPI Hero Card - Base Styles
   ========================================================================== */
.kpi-hero-card {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: kpiSlideIn 0.4s ease-out both;
}

/* Staggered animation delays for KPI cards */
.kpi-hero-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-hero-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-hero-card:nth-child(4) { animation-delay: 0.2s; }
.kpi-hero-card:nth-child(5) { animation-delay: 0.25s; }
.kpi-hero-card:nth-child(6) { animation-delay: 0.3s; }

.kpi-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* Success variant (green) */
.kpi-hero-card.success {
    background: linear-gradient(145deg,
        rgba(34, 197, 94, 0.15) 0%,
        rgba(22, 163, 74, 0.08) 50%,
        rgba(16, 185, 129, 0.12) 100%);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.kpi-hero-card.success:hover {
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

/* Info variant (cyan) */
.kpi-hero-card.info {
    background: linear-gradient(145deg,
        rgba(6, 182, 212, 0.15) 0%,
        rgba(8, 145, 178, 0.08) 50%,
        rgba(14, 165, 233, 0.12) 100%);
    border: 1px solid rgba(6, 182, 212, 0.35);
}

.kpi-hero-card.info:hover {
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.5);
}

/* Warning variant (amber) */
.kpi-hero-card.warning {
    background: linear-gradient(145deg,
        rgba(251, 191, 36, 0.15) 0%,
        rgba(245, 158, 11, 0.08) 50%,
        rgba(234, 179, 8, 0.12) 100%);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.kpi-hero-card.warning:hover {
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
}

/* Primary variant (blue) */
.kpi-hero-card.primary {
    background: linear-gradient(145deg,
        rgba(59, 130, 246, 0.15) 0%,
        rgba(37, 99, 235, 0.08) 50%,
        rgba(29, 78, 216, 0.12) 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.kpi-hero-card.primary:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

/* ==========================================================================
   KPI Card Elements
   ========================================================================== */
.kpi-hero-card .kpi-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.kpi-hero-card.success .kpi-card-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.kpi-hero-card.info .kpi-card-icon {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
}

.kpi-hero-card.warning .kpi-card-icon {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.kpi-hero-card.primary .kpi-card-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.kpi-hero-card .kpi-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(148, 163, 184, 0.9);
}

.kpi-hero-card .kpi-card-value {
    font-family: 'Montserrat', -apple-system, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.kpi-hero-card.success .kpi-card-value {
    color: #4ade80;
}

.kpi-hero-card.info .kpi-card-value {
    color: #22d3ee;
}

.kpi-hero-card.warning .kpi-card-value {
    color: #fbbf24;
}

.kpi-hero-card.primary .kpi-card-value {
    color: #60a5fa;
}

.kpi-hero-card .kpi-card-sublabel {
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.7);
}

/* ==========================================================================
   Loading Skeleton
   ========================================================================== */
.kpi-skeleton {
    animation: kpi-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes kpi-skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.kpi-skeleton-value {
    width: 60px;
    height: 28px;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 4px;
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */
@media (max-width: 991.98px) {
    .kpi-hero-bar {
        flex-wrap: wrap;
    }

    .kpi-cards-row {
        flex-wrap: wrap;
    }

    .welcome-card {
        min-width: 100%;
        order: -1;
    }

    .kpi-hero-card {
        min-width: calc(50% - 0.5rem);
    }
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */
@media (max-width: 767.98px) {
    .kpi-hero-bar {
        padding: 1rem;
        gap: 0.75rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .kpi-cards-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .welcome-card {
        min-width: 100%;
        padding: 1rem;
    }

    .welcome-logo {
        height: 56px;
        width: auto;
        max-width: 100px;
    }

    .welcome-company-name {
        font-size: 1.15rem;
    }

    .welcome-brand-text {
        font-size: 1.25rem;
    }

    .kpi-hero-card {
        min-width: 100%;
        padding: 0.875rem 1rem;
    }

    .kpi-hero-card .kpi-card-value {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   Responsive - XSmall Mobile
   ========================================================================== */
@media (max-width: 575.98px) {
    .kpi-hero-bar {
        padding: 0.75rem;
    }

    .welcome-card {
        padding: 0.75rem;
    }

    .welcome-logo {
        height: 48px;
        width: auto;
        max-width: 80px;
    }

    .welcome-company-name {
        font-size: 1rem;
    }

    .welcome-brand-text {
        font-size: 1.1rem;
    }

    .welcome-subtitle {
        font-size: 0.6rem;
    }

    .welcome-period {
        font-size: 0.6rem;
    }

    .kpi-hero-card {
        padding: 0.75rem;
    }

    .kpi-hero-card .kpi-card-label {
        font-size: 0.65rem;
    }

    .kpi-hero-card .kpi-card-value {
        font-size: 1.35rem;
    }
}

/* ==========================================================================
   Reduced Motion - Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .kpi-hero-bar,
    .welcome-card,
    .kpi-hero-card {
        animation: none;
    }

    .kpi-hero-card:hover,
    .welcome-card:hover {
        transform: none;
    }
}
