/* ==========================================================
   UAD STATISTICS / UAD DALAM ANGKA
   ========================================================== */


/* ==========================================================
   ADMIN / GENERAL
   ========================================================== */

.wrap h1 {
    margin-bottom: 20px;
}

.wrap .card {
    background: #fff;
    padding: 25px;
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.wrap table {
    margin-top: 15px;
}


/* ==========================================================
   UAD CARD
   ========================================================== */

.uad-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
}

.uad-card h2 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.uad-card table {
    margin-top: 15px;
}


/* ==========================================================
   SYNC
   ========================================================== */

#uad-sync-now {
    margin-left: 8px;
}


/* ==========================================================
   STATUS CARD
   ========================================================== */

.uad-status-card {
    margin-top: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.uad-status-card h2 {
    margin-top: 0;
}

#uad-status {
    font-weight: 600;
}


/* ==========================================================
   STATUS CONNECTION
   ========================================================== */

.uad-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    color: #fff;
    font-size: 12px;
}

.uad-status.success {
    background: #28a745;
}

.uad-status.error {
    background: #dc3545;
}

.uad-status.syncing {
    background: #f39c12;
}


/* ==========================================================
   UAD STATISTICS
   ========================================================== */

.uad-statistics {

    --uad-card-size: 100px;
    --uad-gap: 12px;
    --uad-radius: 20px;

    width: 100%;
    max-width: 100%;
    margin: 40px auto;

    padding: 0;

    box-sizing: border-box;

    position: relative;

    display: block;

    visibility: visible !important;
}


/* ==========================================================
   BOX SIZING
   ========================================================== */

.uad-statistics,
.uad-statistics *,
.uad-statistics *::before,
.uad-statistics *::after {

    box-sizing: border-box;

}


/* ==========================================================
   GRID DESKTOP
   ========================================================== */

.uad-statistics-grid {

    width: 100%;
    max-width: 100%;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    grid-template-rows:
        repeat(4, var(--uad-card-size));

    gap: var(--uad-gap);

    position: relative;

    visibility: visible !important;
}


/* ==========================================================
   STAT CARD
   ========================================================== */

.uad-statistics .stat-card {

    position: relative;

    display: flex;

    flex-direction: column;

    justify-content: flex-end;

    align-items: stretch;

    width: 100%;

    min-width: 0;

    min-height: 0;

    padding: 20px;

    border-radius: var(--uad-radius);

    overflow: hidden;

    color: inherit;

    cursor: default;

    backface-visibility: visible;

    transform-style: flat;

    /*
     * Jangan gunakan contain: layout paint.
     * Pada beberapa browser/mobile rendering dapat
     * menyebabkan isi card tidak dirender sebagaimana mestinya.
     */

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        opacity 0.6s ease;

    visibility: visible !important;
}


/* ==========================================================
   HOVER
   ========================================================== */

.uad-statistics .stat-card:hover {

    transform: translateY(-8px);

    box-shadow:
        0 18px 35px rgba(0, 0, 0, 0.18);

}


/* ==========================================================
   CONTENT
   ========================================================== */

.uad-statistics .stat-content {

    display: flex;

    flex-direction: column;

    justify-content: flex-end;

    align-items: flex-start;

    gap: 6px;

    position: relative;

    z-index: 2;

    width: 100%;

    visibility: visible !important;

}


/* ==========================================================
   EMPTY CARD
   ========================================================== */

.uad-statistics .stat-empty {

    background: #f2f2f2;

}


/* ==========================================================
   LABEL
   ========================================================== */

.uad-statistics .label {

    display: block;

    width: 100%;

    margin: 0;

    padding: 0;

    font-size: 14px;

    font-weight: 700;

    text-transform: uppercase;

    line-height: 1.2;

    visibility: visible !important;
}


/* ==========================================================
   NUMBER
   ========================================================== */

.uad-statistics .number {

    display: block;

    width: 100%;

    margin: 0;

    padding: 0;

    font-size: 34px;

    font-weight: 800;

    line-height: 1.1;

    visibility: visible !important;
}


/* ==========================================================
   COLORS
   ========================================================== */

.uad-statistics .stat-gray {

    background: #d9d9d9;
    color: #222;

}

.uad-statistics .stat-blue {

    background: #2d67ff;
    color: #fff;

}

.uad-statistics .stat-orange {

    background: #ff7900;
    color: #fff;

}

.uad-statistics .stat-green {

    background: #0f934b;
    color: #fff;

}

.uad-statistics .stat-purple {

    background: #684cff;
    color: #fff;

}

.uad-statistics .stat-red {

    background: #ff4d17;
    color: #fff;

}

.uad-statistics .stat-brown {

    background: #6f3a3a;
    color: #fff;

}

.uad-statistics .stat-green-dark {

    background: #00853d;
    color: #fff;

}


/* ==========================================================
   GRID POSITION DESKTOP
   ========================================================== */

.uad-statistics .stat-dosen {

    grid-column: 1;
    grid-row: 2;

}

.uad-statistics .stat-sertifikasi {

    grid-column: 2;
    grid-row: 2;

}

.uad-statistics .stat-alumni {

    grid-column: 3;
    grid-row: 1 / span 2;

}

.uad-statistics .stat-empty-right {

    grid-column: 4;
    grid-row: 1 / span 2;

}

.uad-statistics .stat-inbound {

    grid-column: 2;
    grid-row: 3;

}

.uad-statistics .stat-dosen-int {

    grid-column: 3;
    grid-row: 3;

}

.uad-statistics .stat-aktif {

    grid-column: 1 / span 2;
    grid-row: 4;

}

.uad-statistics .stat-outbound {

    grid-column: 3;
    grid-row: 4;

}

.uad-statistics .stat-internasional {

    grid-column: 4;
    grid-row: 3 / span 2;

}


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

@media (max-width: 991px) {

    .uad-statistics {

        width: 100%;
        max-width: 100%;

        margin: 30px auto;

        padding: 0 10px;

    }


    .uad-statistics-grid {

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        grid-template-rows: none;

        grid-auto-rows: 170px;

        gap: 18px;

    }


    .uad-statistics .stat-card {

        grid-column: auto !important;

        grid-row: auto !important;

        min-height: 170px;

        height: auto;

    }


    /*
     * Empty card tidak diperlukan di tablet
     */

    .uad-statistics .stat-empty,
    .uad-statistics .stat-empty-right {

        display: none !important;

    }

}


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

@media (max-width: 767px) {

    /*
     * Pastikan container terlihat.
     */

    .uad-statistics {

        display: block !important;

        width: 100% !important;

        max-width: 100% !important;

        height: auto !important;

        min-height: 1px;

        margin: 25px auto !important;

        padding: 0 10px !important;

        opacity: 1 !important;

        visibility: visible !important;

        overflow: visible !important;

    }


    /*
     * Grid berubah menjadi 1 kolom.
     */

    .uad-statistics-grid {

        display: flex !important;

        flex-direction: column !important;

        width: 100% !important;

        height: auto !important;

        min-height: 1px;

        gap: 18px;

        opacity: 1 !important;

        visibility: visible !important;

        overflow: visible !important;

    }


    /*
     * Semua posisi grid desktop di-reset.
     */

    .uad-statistics .stat-card {

        display: flex !important;

        position: relative !important;

        width: 100% !important;

        min-width: 0 !important;

        min-height: 170px !important;

        height: auto !important;

        margin: 0 !important;

        grid-column: auto !important;

        grid-row: auto !important;

        transform: none !important;

        opacity: 1 !important;

        visibility: visible !important;

        overflow: hidden;

    }


    /*
     * Empty card disembunyikan.
     */

    .uad-statistics .stat-empty,
    .uad-statistics .stat-empty-right {

        display: none !important;

    }


    /*
     * Content
     */

    .uad-statistics .stat-content {

        display: flex !important;

        width: 100% !important;

        opacity: 1 !important;

        visibility: visible !important;

    }


    /*
     * Label
     */

    .uad-statistics .label {

        display: block !important;

        width: 100% !important;

        font-size: 18px !important;

        line-height: 1.2 !important;

        opacity: 1 !important;

        visibility: visible !important;

    }


    /*
     * Number
     */

    .uad-statistics .number {

        display: block !important;

        width: 100% !important;

        font-size: 42px !important;

        line-height: 1.1 !important;

        opacity: 1 !important;

        visibility: visible !important;

    }


    /*
     * Matikan animation pada mobile.
     *
     * Ini penting jika animation.js memberikan
     * transform / opacity pada card.
     */

    .uad-statistics .uad-animate,
    .uad-statistics .uad-animate.show,
    .js .uad-statistics .uad-animate,
    .js .uad-statistics .uad-animate.show {

        opacity: 1 !important;

        visibility: visible !important;

        transform: none !important;

        transition: none !important;

        animation: none !important;

    }

}


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

@media (max-width: 480px) {

    .uad-statistics {

        padding: 0 8px !important;

    }


    .uad-statistics-grid {

        gap: 15px;

    }


    .uad-statistics .stat-card {

        min-height: 155px !important;

        padding: 18px !important;

        border-radius: 18px;

    }


    .uad-statistics .label {

        font-size: 16px !important;

    }


    .uad-statistics .number {

        font-size: 36px !important;

    }

}


/* ==========================================================
   FADE UP ANIMATION
   ========================================================== */


/*
 * Default:
 * tetap tampil jika JavaScript tidak aktif.
 */

.uad-statistics .uad-animate {

    opacity: 1;

    transform: none;

}


/*
 * Jika JavaScript aktif,
 * animasi hanya berlaku pada desktop/tablet.
 */

.js .uad-statistics .uad-animate {

    opacity: 0;

    transform: translateY(70px);

}


/*
 * Setelah masuk viewport.
 */

.js .uad-statistics .uad-animate.show {

    opacity: 1;

    transform: translateY(0);

}


/* ==========================================================
   ANIMATION DELAY
   ========================================================== */

.uad-statistics .uad-animate:nth-child(1) {
    transition-delay: .05s;
}

.uad-statistics .uad-animate:nth-child(2) {
    transition-delay: .10s;
}

.uad-statistics .uad-animate:nth-child(3) {
    transition-delay: .15s;
}

.uad-statistics .uad-animate:nth-child(4) {
    transition-delay: .20s;
}

.uad-statistics .uad-animate:nth-child(5) {
    transition-delay: .25s;
}

.uad-statistics .uad-animate:nth-child(6) {
    transition-delay: .30s;
}

.uad-statistics .uad-animate:nth-child(7) {
    transition-delay: .35s;
}

.uad-statistics .uad-animate:nth-child(8) {
    transition-delay: .40s;
}

.uad-statistics .uad-animate:nth-child(9) {
    transition-delay: .45s;
}

.uad-statistics .uad-animate:nth-child(10) {
    transition-delay: .50s;
}

.uad-statistics .uad-animate:nth-child(11) {
    transition-delay: .55s;
}

.uad-statistics .uad-animate:nth-child(12) {
    transition-delay: .60s;
}


/* ==========================================================
   ACCESSIBILITY
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .uad-statistics .uad-animate,
    .uad-statistics .uad-animate.show,
    .uad-statistics .stat-card {

        opacity: 1 !important;

        transform: none !important;

        transition: none !important;

        animation: none !important;

    }

}