/* KYRO Dashboard-Specific Styles - Premium Light Theme Design */

/* Dashboard Layout */
.dashboard-header {
    background: transparent;
    color: var(--kyro-text-primary);
    padding: 1.5rem 0;
    margin: 0 0 1.5rem 0;
    border-bottom: 1px solid rgba(124, 143, 172, 0.12);
}

.dashboard-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--kyro-primary);
    margin: 0;
}

.dashboard-subtitle {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--kyro-text-secondary);
    margin: 0.25rem 0 0 0;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* KPI Card Variants - Clean Premium White Cards with Border Indicators */
.kpi-card {
    background: #ffffff;
    border: 1px solid rgba(124, 143, 172, 0.12);
    border-radius: 12px;
    box-shadow: 0px 12px 24px -4px rgba(145, 158, 171, 0.12), 0px 0px 2px rgba(145, 158, 171, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    padding: 1.25rem;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 16px 32px -4px rgba(145, 158, 171, 0.18), 0px 0px 4px rgba(145, 158, 171, 0.2);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
}

.kpi-card.kpi-blue::before {
    background-color: var(--kyro-primary);
}

.kpi-card.kpi-red::before {
    background-color: var(--kyro-danger);
}

.kpi-card.kpi-orange::before {
    background-color: #FF8D28;
}

.kpi-card.kpi-green::before {
    background-color: var(--kyro-success);
}

.kpi-card .card-body {
    padding: 0 !important;
}

.kpi-card h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--kyro-text-secondary);
    margin-bottom: 0.5rem;
}

.kpi-card h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--kyro-text-primary);
    margin: 0;
    line-height: 1.1;
}

.kpi-card small {
    font-size: 0.75rem;
    color: var(--kyro-text-muted);
}

.kpi-card .icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-card.kpi-blue .icon-wrapper {
    background-color: rgba(26, 35, 126, 0.08);
    color: var(--kyro-primary);
}

.kpi-card.kpi-red .icon-wrapper {
    background-color: rgba(229, 57, 53, 0.08);
    color: var(--kyro-danger);
}

.kpi-card.kpi-orange .icon-wrapper {
    background-color: rgba(255, 141, 40, 0.08);
    color: #FF8D28;
}

.kpi-card.kpi-green .icon-wrapper {
    background-color: rgba(67, 160, 71, 0.08);
    color: var(--kyro-success);
}

/* KPI Counter */
.kpi-counter {
    font-variant-numeric: tabular-nums;
}

/* Chart Cards styling */
.chart-card {
    background: #ffffff;
    border: 1px solid rgba(124, 143, 172, 0.12);
    border-radius: 12px;
    box-shadow: 0px 12px 24px -4px rgba(145, 158, 171, 0.12), 0px 0px 2px rgba(145, 158, 171, 0.2);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0px 16px 32px -4px rgba(145, 158, 171, 0.18), 0px 0px 4px rgba(145, 158, 171, 0.2);
}

.chart-header {
    background: transparent;
    padding: 1.25rem 1.5rem 0.5rem 1.5rem;
    border-bottom: none;
}

.chart-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--kyro-text-primary);
    margin: 0;
}

.chart-subtitle {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--kyro-text-secondary);
    margin: 0.25rem 0 0 0;
}

.chart-body {
    padding: 1.5rem;
}

.chart-canvas {
    max-height: 280px;
}

/* Alert Feed Card */
.alert-feed {
    background: #ffffff;
    border: 1px solid rgba(124, 143, 172, 0.12);
    border-radius: 12px;
    box-shadow: 0px 12px 24px -4px rgba(145, 158, 171, 0.12), 0px 0px 2px rgba(145, 158, 171, 0.2);
    max-height: 480px;
    overflow-y: auto;
}

.alert-feed-header {
    background: #ffffff;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(124, 143, 172, 0.12);
    position: sticky;
    top: 0;
    z-index: 10;
}

.alert-feed-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(124, 143, 172, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
}

.alert-feed-item:hover {
    background: rgba(26, 35, 126, 0.02);
    transform: translateX(2px);
}

.alert-feed-item:last-child {
    border-bottom: none;
}

.alert-customer {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--kyro-text-primary);
}

.alert-type {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.alert-type.behavioral {
    background: rgba(156, 39, 176, 0.08);
    color: #9c27b0;
}

.alert-type.velocity {
    background: rgba(255, 141, 40, 0.08);
    color: #FF8D28;
}

.alert-type.geography {
    background: rgba(76, 175, 80, 0.08);
    color: #4caf50;
}

.alert-type.volume {
    background: rgba(244, 67, 54, 0.08);
    color: #f44336;
}

.risk-badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Risk Distribution Chart */
.risk-distribution-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.legend-item {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--kyro-text-secondary);
}

/* Performance Gauge */
.performance-gauge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-value {
    position: absolute;
    top: 45%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--kyro-text-primary);
}

.gauge-label {
    position: absolute;
    top: 75%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--kyro-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* System Health Widget */
.system-health {
    background: #ffffff;
    border: 1px solid rgba(124, 143, 172, 0.12);
    border-radius: 12px;
    box-shadow: 0px 12px 24px -4px rgba(145, 158, 171, 0.12), 0px 0px 2px rgba(145, 158, 171, 0.2);
    padding: 1.5rem;
    height: 100%;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(124, 143, 172, 0.08);
}

.health-item:last-child {
    border-bottom: none;
}

.health-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--kyro-text-primary);
}

.health-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Real-time Indicator */
.real-time-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--kyro-success);
    font-weight: 600;
}

.real-time-dot {
    width: 6px;
    height: 6px;
    background: var(--kyro-success);
    border-radius: 50%;
    animation: pulse 1.5s ease infinite;
}

/* Take Action Section */
.take-action-header {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.take-action-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--kyro-text-primary);
    margin: 0;
}

.take-action-subtitle {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--kyro-text-secondary);
    margin-top: 0.25rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Take Action Quick Cards (styled premium white like figma design) */
.quick-action-card {
    background: #ffffff;
    border: 1px solid rgba(124, 143, 172, 0.12);
    border-radius: 15px;
    box-shadow: 0px 12px 24px -4px rgba(145, 158, 171, 0.12), 0px 0px 2px rgba(145, 158, 171, 0.2);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: var(--kyro-text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 16px 32px -4px rgba(145, 158, 171, 0.18), 0px 0px 4px rgba(145, 158, 171, 0.2);
    text-decoration: none;
    color: var(--kyro-text-primary);
}

.quick-action-icon {
    font-size: 2.25rem;
    color: #FF8D28;
    margin-bottom: 1rem;
}

.quick-action-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--kyro-text-primary);
    margin-bottom: 0.5rem;
}

.quick-action-description {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--kyro-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* Action Button styling inside cards */
.quick-action-btn {
    font-family: 'Plus Jakarta Sans', sans-serif;
    padding: 0.5rem 1.5rem;
    background-color: #FF8D28;
    color: #ffffff;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-block;
    transition: all 0.2s;
    border: none;
}

.quick-action-card:hover .quick-action-btn {
    background-color: #e0771f;
}

/* Dark Theme Variables support for Dashboard specifically */
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .alert-feed,
[data-theme="dark"] .alert-feed-header,
[data-theme="dark"] .system-health,
[data-theme="dark"] .quick-action-card {
    background-color: var(--kyro-bg-secondary);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0px 12px 24px -4px rgba(0, 0, 0, 0.35), 0px 0px 2px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .alert-feed-item {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .health-item {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Tablets and below (992px) */
@media (max-width: 992px) {
    .dashboard-header {
        padding: 1.25rem 0;
        margin-bottom: 1.25rem;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .dashboard-subtitle {
        font-size: 0.8125rem;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .kyro-dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    
    .kpi-card h2 {
        font-size: 1.75rem;
    }
}

/* Mobile devices (768px and below) */
@media (max-width: 768px) {
    /* Header */
    .dashboard-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }
    
    .dashboard-title {
        font-size: 1.375rem;
    }
    
    .dashboard-subtitle {
        font-size: 0.75rem;
    }
    
    /* KPI Cards */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
        margin-bottom: 1.25rem;
    }
    
    .kpi-card {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .kpi-card h6 {
        font-size: 0.6875rem;
        margin-bottom: 0.375rem;
    }
    
    .kpi-card h2 {
        font-size: 1.5rem;
    }
    
    .kpi-card small {
        font-size: 0.6875rem;
    }
    
    /* Dashboard Grid */
    .kyro-dashboard-container {
        padding: 0 0.75rem !important;
    }
    
    .kyro-dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* AML Cards */
    .aml-card {
        padding: 1rem !important;
        border-radius: 10px !important;
    }
    
    .aml-card h2 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .aml-subtitle {
        font-size: 0.6875rem !important;
    }
    
    /* Charts */
    .aml-chart {
        height: 180px !important;
        margin-top: 1rem !important;
    }
    
    .aml-donut-wrap {
        width: 160px !important;
        height: 160px !important;
    }
    
    .aml-donut {
        width: 160px !important;
        height: 160px !important;
    }
    
    /* Legends */
    .aml-chart-legend {
        font-size: 0.6875rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .aml-donut-legend {
        gap: 0.75rem !important;
    }
    
    .aml-legend {
        font-size: 0.6875rem !important;
    }
    
    /* Row layouts */
    .row {
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
    }
    
    .row > * {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Cards in rows */
    .card {
        margin-bottom: 0.875rem !important;
        border-radius: 10px !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Behavior pattern section */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
}

/* Small mobile devices (576px and below) */
@media (max-width: 576px) {
    /* Header */
    .dashboard-title {
        font-size: 1.25rem;
    }
    
    .dashboard-subtitle {
        font-size: 0.6875rem;
    }
    
    /* KPI Cards */
    .kpi-card {
        padding: 0.875rem;
    }
    
    .kpi-card h6 {
        font-size: 0.625rem;
    }
    
    .kpi-card h2 {
        font-size: 1.375rem;
    }
    
    .kpi-card small {
        font-size: 0.625rem;
    }
    
    /* Container padding */
    .kyro-dashboard-container {
        padding: 0 0.5rem !important;
    }
    
    /* Cards */
    .aml-card {
        padding: 0.875rem !important;
    }
    
    .aml-card h2 {
        font-size: 0.9375rem !important;
    }
    
    .aml-subtitle {
        font-size: 0.625rem !important;
    }
    
    /* Charts */
    .aml-chart {
        height: 160px !important;
    }
    
    .aml-donut-wrap {
        width: 140px !important;
        height: 140px !important;
    }
    
    .aml-donut {
        width: 140px !important;
        height: 140px !important;
    }
    
    /* Bar labels */
    .aml-gridline span {
        font-size: 0.625rem !important;
    }
    
    /* Legends */
    .aml-legend {
        font-size: 0.625rem !important;
    }
    
    .aml-dot {
        width: 8px !important;
        height: 8px !important;
    }
}

/* Extra small devices (480px and below) */
@media (max-width: 480px) {
    .dashboard-title {
        font-size: 1.125rem;
    }
    
    .kpi-card h2 {
        font-size: 1.25rem;
    }
    
    .aml-chart {
        height: 140px !important;
    }
    
    .aml-donut-wrap {
        width: 120px !important;
        height: 120px !important;
    }
    
    .aml-donut {
        width: 120px !important;
        height: 120px !important;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aml-chart {
        height: 160px !important;
    }
}

/* Print styles */
@media print {
    .dashboard-header {
        border-bottom: 2px solid #000;
        page-break-after: avoid;
    }
    
    .kpi-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
    
    .aml-card {
        page-break-inside: avoid;
        box-shadow: none !important;
    }
}


/* ===========================
   LOADING ANIMATIONS
   =========================== */

/* Skeleton Loader */
.skeleton-loader {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Chart Loading Skeleton */
.chart-skeleton {
    width: 100%;
    height: 220px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 12px;
    position: relative;
}

.chart-skeleton::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #FF8D28;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* KPI Card Loading */
.kpi-skeleton {
    height: 120px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 12px;
}

/* Spinner Overlay */
.chart-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.chart-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #FF8D28;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Pulse Animation for Cards */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Loading Text */
.loading-text {
    color: #94a3b8;
    font-size: 14px;
    margin-top: 12px;
    font-weight: 500;
}

/* Hide Chart Canvas While Loading */
.chart-container.loading canvas {
    opacity: 0.3;
}

/* Donut Chart Loading */
.donut-skeleton {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    margin: 0 auto;
}
