/* ==========================================================
   ANDROLAB SUITE — OPERATIONS DASHBOARD
   Module: dashboard.php
   Author: Carlen @ Androlab
========================================================== */

/* ------------------------------
   KPI GRID
------------------------------ */
.androlab-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.androlab-dashboard-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 5px solid transparent;
}

.androlab-dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Icon section --- */
.androlab-dashboard-card .card-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}

/* --- KPI-specific colors --- */
.kpi-renewals { border-left-color: #3b82f6; }
.kpi-tasks    { border-left-color: #f59e0b; }
.kpi-failed   { border-left-color: #ef4444; }

.kpi-renewals .card-icon { background: #3b82f6; }
.kpi-tasks .card-icon    { background: #f59e0b; }
.kpi-failed .card-icon   { background: #ef4444; }

/* --- Info section --- */
.androlab-dashboard-card .card-info h3 {
    font-size: 15px;
    color: #444;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.androlab-dashboard-card .card-info h3 i {
    color: #ff7a00;
}

.androlab-dashboard-card .kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: #111;
}

/* ------------------------------
   ACTIVITY SECTION
------------------------------ */
.androlab-dashboard-activity {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    padding: 22px;
}

.androlab-dashboard-activity h3 {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.androlab-dashboard-activity h3 i {
    color: #2563eb;
}

/* ------------------------------
   RECENT ACTIVITY LIST
------------------------------ */
.recent-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-activity-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #444;
}

.recent-activity-list li:last-child {
    border-bottom: none;
}

.recent-activity-list strong {
    color: #111;
}

.recent-activity-list .androlab-link {
    margin-left: 6px;
    color: #2563eb;
    text-decoration: none;
}

.recent-activity-list .androlab-link:hover {
    color: #1e40af;
}

.recent-activity-list .activity-date {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

/* ------------------------------
   MOBILE RESPONSIVE
------------------------------ */
@media (max-width: 768px) {
    .androlab-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .androlab-dashboard-card {
        flex-direction: row;
        text-align: left;
    }

    .androlab-dashboard-card .card-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}


/* ==========================================================
   Dashboard KPI Animations — SaaS Style
========================================================== */

/* Shimmer loading placeholder */
.kpi-value.loading {
    display: inline-block;
    width: 60px;
    height: 20px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e6e6e6 25%, #f3f3f3 37%, #e6e6e6 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    color: transparent;
}
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

/* Smooth fade-in once loaded */
.kpi-value {
    opacity: 0;
    font-size: 26px;
    font-weight: 700;
    color: #111;
    transition: opacity 0.4s ease-in-out;
}
.kpi-value.loaded {
    opacity: 1;
}

/* Add a nice hover pulse to the card */
.androlab-dashboard-card:hover .kpi-value {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Dashboard Refresh Button */
.androlab-page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.androlab-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.androlab-refresh-btn:hover {
    background: #1e40af;
}

.androlab-refresh-btn i {
    font-size: 14px;
    transition: transform 0.4s ease;
}

/* Animate rotation while refreshing */
.androlab-refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
