/* =========================================
   ADMIN ANALYTICS PREMIUM CSS
   ========================================= */

.admin-analytics {
    padding: 3rem 2rem;
    background: #f1f5f9;
    min-height: calc(100vh - 70px);
}

@media (max-width: 768px) {
    .admin-analytics {
        padding: 1.5rem 1rem;
    }
}

.admin-analytics__container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

/* Header Section */
.admin-analytics__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

@media (max-width: 576px) {
    .admin-analytics__header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
    }
}

.header-texts h1 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    color: var(--color-primary);
    margin: 0 0 0.25rem 0;
}

@media (max-width: 576px) {
    .header-texts h1 {
        font-size: 1.75rem;
    }
}

.header-texts p {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #10b981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.live-indicator .dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: analyticsPulse 2s infinite;
}

@keyframes analyticsPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Stats Row */
.analytics-grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 380px) {
    .analytics-grid-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: #fff;
    padding: 1.75rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.3s ease;
}

@media (max-width: 576px) {
    .stat-card {
        padding: 1.25rem;
    }
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-info h3 {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 0.4rem 0;
}

.stat-info .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

/* Charts Grid */
.analytics-grid-charts {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .analytics-grid-charts {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.04);
}

@media (max-width: 576px) {
    .chart-card {
        padding: 1.25rem;
    }
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.chart-header h3 {
    font-size: 1.2rem;
    color: #1e293b;
    font-weight: 700;
    margin: 0;
}

.chart-body {
    position: relative;
    width: 100%;
}

.chart-body canvas {
    max-width: 100% !important;
}

#dailyChart { height: 350px !important; }
#pageChart { max-height: 350px !important; width: 100% !important; }

/* Info Grid (Tables) */
.analytics-grid-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .analytics-grid-info {
        grid-template-columns: 1fr;
    }
}

.info-card {
    background: #fff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.04);
}

.info-header {
    margin-bottom: 1.5rem;
}

.info-header h3 {
    font-size: 1.2rem;
    color: #1e293b;
    font-weight: 700;
    margin: 0;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-table th {
    text-align: left;
    font-size: 0.85rem;
    color: #94a3b8;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-table td {
    padding: 1.25rem 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

.analytics-table tr:hover td {
    background: #f8fafc;
}

/* Visitor List Component */
.visitor-list {
    display: flex;
    flex-direction: column;
}

.visitor-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

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

.visitor-icon {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #94a3b8;
}

.visitor-icon svg {
    width: 20px;
    height: 20px;
}

.visitor-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.v-url {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.v-geo {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.v-geo::before {
    content: "📍";
    font-size: 10px;
}

.visitor-time {
    font-size: 0.8rem;
    color: #94a3b8;
    background: #f8fafc;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
}
