/* =====================================================
   DLE STATISTICS
   ===================================================== */
   

.dle-statistics {
    --stats-primary: #0d6efd;
    --stats-success: #198754;
    --stats-warning: #f0ad00;
    --stats-info: #0dcaf0;
    --stats-danger: #dc3545;

    --stats-radius: 20px;
    --stats-radius-small: 14px;

    width: 100%;
}


/* =====================================================
   MAIN CARD
   ===================================================== */

.dle-statistics .dashboard-card {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: var(--stats-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .05);
}


/* =====================================================
   HEADER
   ===================================================== */

.dle-statistics .dashboard-header {
    margin-bottom: 1.5rem;
}

.dle-statistics .dashboard-title {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.dle-statistics .title-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(13, 110, 253, .12);
    color: var(--stats-primary);

    font-size: 1.2rem;
}

.dle-statistics .dashboard-title h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bs-emphasis-color);
}

.dle-statistics .dashboard-subtitle {
    margin-top: .2rem;
    color: var(--bs-secondary-color);
    font-size: .82rem;
}


/* =====================================================
   PERIOD CARDS
   ===================================================== */

.dle-statistics .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dle-statistics .stats-card {
    position: relative;
    overflow: hidden;

    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 18px;

    padding: 1.15rem;

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.dle-statistics .stats-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 3px;

    opacity: .8;
}

.dle-statistics .stats-day::before {
    background: linear-gradient(
        90deg,
        #198754,
        #20c997
    );
}

.dle-statistics .stats-week::before {
    background: linear-gradient(
        90deg,
        #0d6efd,
        #6ea8fe
    );
}

.dle-statistics .stats-month::before {
    background: linear-gradient(
        90deg,
        #dc3545,
        #ff6b81
    );
}

.dle-statistics .stats-card:hover {
    transform: translateY(-3px);

    border-color: rgba(13, 110, 253, .18);

    box-shadow:
        0 .75rem 1.5rem rgba(0, 0, 0, .08);
}


/* =====================================================
   STATS HEADER
   ===================================================== */

.dle-statistics .stats-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;

    margin-bottom: 1.1rem;
}

.dle-statistics .stat-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;

    border-radius: 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1rem;
}

.dle-statistics .stats-day .stat-icon {
    background: rgba(25, 135, 84, .12);
    color: var(--stats-success);
}

.dle-statistics .stats-week .stat-icon {
    background: rgba(13, 110, 253, .12);
    color: var(--stats-primary);
}

.dle-statistics .stats-month .stat-icon {
    background: rgba(220, 53, 69, .12);
    color: var(--stats-danger);
}

.dle-statistics .stats-period {
    font-size: .98rem;
    font-weight: 700;
    color: var(--bs-emphasis-color);
}

.dle-statistics .stats-description {
    margin-top: .15rem;
    color: var(--bs-secondary-color);
    font-size: .72rem;
}


/* =====================================================
   STAT ROWS
   ===================================================== */

.dle-statistics .stat-list {
    display: flex;
    flex-direction: column;
}

.dle-statistics .stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 48px;

    padding: .55rem 0;

    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.dle-statistics .stat-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dle-statistics .stat-name {
    display: flex;
    align-items: center;
    gap: .55rem;

    color: var(--bs-body-color);
    font-size: .9rem;
}

.dle-statistics .stat-item-icon {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    font-size: .75rem;
}

.dle-statistics .stat-item-icon.news {
    background: rgba(13, 110, 253, .10);
    color: var(--stats-primary);
}

.dle-statistics .stat-item-icon.comments {
    background: rgba(255, 193, 7, .14);
    color: #b98500;
}

.dle-statistics .stat-item-icon.users {
    background: rgba(13, 202, 240, .13);
    color: #089bb9;
}


/* =====================================================
   VALUE BADGES
   ===================================================== */

.dle-statistics .stat-value {
    min-width: 52px;

    padding: .42rem .7rem;

    border-radius: 10px;

    text-align: center;

    font-size: .8rem;
    font-weight: 700;

    line-height: 1;
}

.dle-statistics .stat-value.primary {
    background: rgba(13, 110, 253, .11);
    color: var(--stats-primary);
}

.dle-statistics .stat-value.warning {
    background: rgba(255, 193, 7, .16);
    color: #a97800;
}

.dle-statistics .stat-value.info {
    background: rgba(13, 202, 240, .13);
    color: #078ca8;
}


/* =====================================================
   SECTION TITLE
   ===================================================== */

.dle-statistics .section-heading {
    display: flex;
    align-items: center;
    gap: .8rem;

    margin: 1.8rem 0 1rem;

    color: var(--bs-secondary-color);

    font-size: .75rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .08em;
}

.dle-statistics .section-line {
    height: 1px;
    flex: 1;

    background: var(--bs-border-color);
}


/* =====================================================
   BOTTOM CARDS
   ===================================================== */

.dle-statistics .stats-grid-bottom {
    grid-template-columns: repeat(3, 1fr);
}

.dle-statistics .info-card {
    background: var(--bs-body-bg);

    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 18px;

    padding: 1.15rem;

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.dle-statistics .info-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 .65rem 1.4rem rgba(0, 0, 0, .07);
}

.dle-statistics .info-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;

    margin-bottom: 1rem;
}

.dle-statistics .info-icon {
    width: 42px;
    height: 42px;

    border-radius: 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

.dle-statistics .info-icon.primary {
    background: rgba(13, 110, 253, .12);
    color: var(--stats-primary);
}

.dle-statistics .info-icon.info {
    background: rgba(13, 202, 240, .13);
    color: #089bb9;
}

.dle-statistics .info-icon.warning {
    background: rgba(255, 193, 7, .15);
    color: #b98500;
}

.dle-statistics .info-card-header h3 {
    margin: 0;

    font-size: 1rem;
    font-weight: 700;

    color: var(--bs-emphasis-color);
}

.dle-statistics .info-card-header span {
    display: block;

    margin-top: .15rem;

    font-size: .72rem;
    color: var(--bs-secondary-color);
}


/* =====================================================
   INFO ROWS
   ===================================================== */

.dle-statistics .info-list {
    display: flex;
    flex-direction: column;
}

.dle-statistics .info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 44px;

    border-bottom: 1px solid var(--bs-border-color-translucent);

    color: var(--bs-body-color);

    font-size: .86rem;
}

.dle-statistics .info-row.last {
    border-bottom: 0;
}

.dle-statistics .number {
    font-size: .85rem;
    font-weight: 700;
}

.dle-statistics .number.primary {
    color: var(--stats-primary);
}

.dle-statistics .number.success {
    color: var(--stats-success);
}

.dle-statistics .number.info {
    color: #089bb9;
}

.dle-statistics .number.warning {
    color: #b98500;
}

.dle-statistics .number.danger {
    color: var(--stats-danger);
}


/* =====================================================
   COMMENTS
   ===================================================== */

.dle-statistics .comments-total {
    padding: .45rem 0 1rem;
}

.dle-statistics .comments-total-number {
    font-size: 2rem;
    line-height: 1.1;

    font-weight: 800;

    color: var(--bs-emphasis-color);
}

.dle-statistics .comments-total-label {
    margin-top: .25rem;

    color: var(--bs-secondary-color);

    font-size: .75rem;
}

.dle-statistics .comments-button {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    padding: .7rem .8rem;

    border-radius: 11px;

    background: rgba(255, 193, 7, .10);

    color: #a97800;
    text-decoration: none;

    font-size: .8rem;
    font-weight: 600;

    transition:
        background .2s ease,
        transform .2s ease;
}

.dle-statistics .comments-button:hover {
    background: rgba(255, 193, 7, .17);

    transform: translateX(2px);

    color: #916d00;
}

.dle-statistics .comments-button span {
    display: flex;
    align-items: center;
    gap: .4rem;
}


/* =====================================================
   DATABASE
   ===================================================== */

.dle-statistics .database-card {
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;

    min-height: 96px;

    padding: 1.25rem 1.4rem;

    margin-bottom: 1.5rem;

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            var(--bs-primary),
            #4f8dfd
        );

    color: #fff;

    box-shadow:
        0 .45rem 1.3rem rgba(13, 110, 253, .2);
}

.dle-statistics .database-icon {
    width: 52px;
    height: 52px;

    min-width: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 1rem;

    border-radius: 15px;

    background: rgba(255, 255, 255, .16);

    font-size: 1.25rem;
}

.dle-statistics .database-label {
    font-size: .75rem;

    opacity: .8;

    margin-bottom: .15rem;
}

.dle-statistics .database-value {
    font-size: 1.35rem;

    line-height: 1.2;

    font-weight: 800;
}

.dle-statistics .database-decoration {
    position: absolute;

    right: 1.5rem;
    top: 50%;

    transform: translateY(-50%);

    font-size: 5rem;

    opacity: .08;

    pointer-events: none;
}


/* =====================================================
   TOP USERS
   ===================================================== */

.dle-statistics .top-users-card {
    overflow: hidden;

    background: var(--bs-tertiary-bg);

    border: 1px solid var(--bs-border-color-translucent);

    border-radius: 20px;

    box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .05);
}

.dle-statistics .top-users-header {
    padding: 1.2rem 1.3rem;

    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.dle-statistics .top-users-title {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.dle-statistics .trophy-icon {
    width: 44px;
    height: 44px;

    min-width: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: rgba(255, 193, 7, .15);

    color: #d39e00;

    font-size: 1.05rem;
}

.dle-statistics .top-users-title h2 {
    margin: 0;

    color: var(--bs-emphasis-color);

    font-size: 1rem;
    font-weight: 700;
}

.dle-statistics .top-users-title span {
    display: block;

    margin-top: .15rem;

    color: var(--bs-secondary-color);

    font-size: .72rem;
}

.dle-statistics .top-users-table {
    padding: 0;
}

.dle-statistics .top-users-table .table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(13, 110, 253, .04);

    color: var(--bs-body-color);

    width: 100%;
}

.dle-statistics .top-users-table .table > :not(caption) > * > * {
    padding: .8rem 1rem;

    border-bottom-color: var(--bs-border-color-translucent);
}


/* =====================================================
   FIX LAST COLUMN "ПС"
   ===================================================== */

.dle-statistics .top-users-table .table th:last-child,
.dle-statistics .top-users-table .table td:last-child {
    width: 70px;
    min-width: 70px;
    max-width: 70px;

    text-align: center;

    white-space: nowrap;
}

.dle-statistics .top-users-table tbody tr {
    transition: background .2s ease;
}

.dle-statistics .top-users-table tbody tr:hover {
    background: rgba(13, 110, 253, .04);
}


/* =====================================================
   DARK THEME
   ===================================================== */

[data-bs-theme="dark"] .dle-statistics .dashboard-card,
[data-bs-theme="dark"] .dle-statistics .top-users-card {
    box-shadow:
        0 .3rem 1rem rgba(0, 0, 0, .18);
}

[data-bs-theme="dark"] .dle-statistics .stats-card,
[data-bs-theme="dark"] .dle-statistics .info-card {
    box-shadow:
        0 .2rem .7rem rgba(0, 0, 0, .15);
}

[data-bs-theme="dark"] .dle-statistics .stats-card:hover,
[data-bs-theme="dark"] .dle-statistics .info-card:hover {
    box-shadow:
        0 .7rem 1.5rem rgba(0, 0, 0, .25);
}


/* =====================================================
   TABLET
   ===================================================== */

@media (max-width: 900px) {

    .dle-statistics .stats-grid,
    .dle-statistics .stats-grid-bottom {
        grid-template-columns: repeat(2, 1fr);
    }

    .dle-statistics .stats-card:last-child {
        grid-column: 1 / -1;
    }

}


/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 600px) {

    .dle-statistics .dashboard-card {
        padding: 1rem;

        border-radius: 16px;
    }

    .dle-statistics .stats-grid,
    .dle-statistics .stats-grid-bottom {
        grid-template-columns: 1fr;
    }

    .dle-statistics .stats-card:last-child {
        grid-column: auto;
    }

    .dle-statistics .dashboard-title h1 {
        font-size: 1.15rem;
    }

    .dle-statistics .dashboard-subtitle {
        font-size: .72rem;
    }

    .dle-statistics .title-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .dle-statistics .stats-card,
    .dle-statistics .info-card {
        border-radius: 15px;
    }

    .dle-statistics .database-card {
        border-radius: 16px;

        padding: 1rem;
    }

    .dle-statistics .database-decoration {
        display: none;
    }

    .dle-statistics .database-value {
        font-size: 1.15rem;
    }

    .dle-statistics .top-users-card {
        border-radius: 16px;
    }

    .dle-statistics .top-users-header {
        padding: 1rem;
    }

    .dle-statistics .top-users-table .table > :not(caption) > * > * {
        padding: .7rem;
    }

    /* ПС на мобильном тоже не переносим */

    .dle-statistics .top-users-table .table th:last-child,
    .dle-statistics .top-users-table .table td:last-child {
        width: 70px;
        min-width: 70px;
        max-width: 70px;

        white-space: nowrap;
        text-align: center;
    }

}


/* =====================================================
   VERY SMALL SCREENS
   ===================================================== */

@media (max-width: 400px) {

    .dle-statistics .dashboard-title {
        align-items: flex-start;
    }

    .dle-statistics .stat-name {
        font-size: .84rem;
    }

    .dle-statistics .stat-value {
        min-width: 46px;

        padding: .38rem .55rem;

        font-size: .75rem;
    }

    .dle-statistics .info-row {
        font-size: .82rem;
    }

    .dle-statistics .comments-total-number {
        font-size: 1.7rem;
    }

}