/* ==========================================================
   SMART FLOATING WIDGET SPMB
   SMP Negeri 1 Bagan Sinembah
   Version : 2.0
   File    : widget.css
========================================================== */


/* ==========================================================
   ROOT VARIABLES
========================================================== */

:root{

    --primary:#0d6efd;
    --primary-dark:#0b5ed7;

    --success:#16a34a;
    --warning:#f59e0b;
    --danger:#dc2626;
    --info:#0ea5e9;

    --white:#ffffff;
    --light:#f8fafc;
    --border:#e5e7eb;

    --dark:#111827;
    --gray:#6b7280;

    --radius:22px;
    --radius-sm:14px;

    --shadow-sm:
        0 8px 18px rgba(0,0,0,.08);

    --shadow-md:
        0 15px 40px rgba(0,0,0,.15);

    --shadow-lg:
        0 25px 60px rgba(0,0,0,.20);

    --transition:
        all .30s ease;

}


/* ==========================================================
   RESET
========================================================== */

.spmb-overlay *,
.spmb-overlay *::before,
.spmb-overlay *::after{

    margin:0;
    padding:0;
    box-sizing:border-box;

}

.spmb-overlay{

    font-family:
    "Inter",
    "Poppins",
    sans-serif;

    z-index:99999;

}


/* ==========================================================
   OVERLAY
========================================================== */

.spmb-overlay{

    position:fixed;

    right:24px;

    bottom:24px;

    display:flex;

    justify-content:flex-end;

    align-items:flex-end;

    pointer-events:none;

}


/* ==========================================================
   WIDGET
========================================================== */

.spmb-widget{

    width:380px;

    max-width:calc(100vw - 30px);

    background:#ffffff;

    border-radius:var(--radius);

    overflow:hidden;

    box-shadow:var(--shadow-lg);

    border:1px solid rgba(255,255,255,.25);

    backdrop-filter:blur(16px);

    pointer-events:auto;

    transition:var(--transition);

    animation:
    widgetFade .45s ease;

}


/* ==========================================================
   HEADER
========================================================== */

.spmb-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:18px 20px;

    background:

    linear-gradient(
        135deg,
        #0d6efd,
        #2563eb
    );

    color:#ffffff;

}


/* ==========================================================
   BRAND
========================================================== */

.spmb-brand{

    display:flex;

    align-items:center;

    gap:14px;

}


/* ==========================================================
   ICON
========================================================== */

.spmb-logo{

    width:52px;

    height:52px;

    border-radius:50%;

    background:

    rgba(255,255,255,.18);

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:24px;

    flex-shrink:0;

}


/* ==========================================================
   TITLE
========================================================== */

.spmb-heading h5{

    font-size:18px;

    font-weight:700;

    margin-bottom:4px;

    letter-spacing:.3px;

}

.spmb-heading small{

    display:block;

    opacity:.95;

    font-size:13px;

}


/* ==========================================================
   HEADER ACTION
========================================================== */

.spmb-action{

    display:flex;

    align-items:center;

}


/* ==========================================================
   TOGGLE BUTTON
========================================================== */

.widget-toggle{

    width:42px;

    height:42px;

    border:none;

    outline:none;

    border-radius:50%;

    cursor:pointer;

    background:

    rgba(255,255,255,.15);

    color:#ffffff;

    transition:var(--transition);

}

.widget-toggle:hover{

    transform:rotate(180deg);

    background:

    rgba(255,255,255,.25);

}


/* ==========================================================
   BODY
========================================================== */

.spmb-body{

    padding:20px;

    background:#ffffff;

}

/* ==========================================================
   SERVER CLOCK
========================================================== */

.server-clock{

    display:flex;

    align-items:center;

    gap:14px;

    padding:14px 18px;

    margin-bottom:18px;

    border-radius:18px;

    background:#f8fafc;

    border:1px solid var(--border);

}

.server-clock-icon{

    width:46px;

    height:46px;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:50%;

    background:linear-gradient(
        135deg,
        #2563eb,
        #0ea5e9
    );

    color:#ffffff;

    font-size:18px;

    flex-shrink:0;

}

.server-clock-content{

    display:flex;

    flex-direction:column;

}

.server-clock-content small{

    color:var(--gray);

    font-size:12px;

    margin-bottom:2px;

}

#serverClock{

    font-size:12px;

    font-weight:500;

    color:var(--dark);

    letter-spacing:.3px;

}


/* ==========================================================
   REMAINING BADGE
========================================================== */

.remaining-wrapper{

    margin-bottom:8px;

}

.remaining-badge{

    display:flex;

    align-items:center;

    justify-content:center;

    gap:4px;

    padding:10px 12px;

    border-radius:999px;

    background:linear-gradient(
        135deg,
        #22c55e,
        #16a34a
    );

    color:#ffffff;

    font-size:12px;

    font-weight:500;

    box-shadow:var(--shadow-sm);

    transition:var(--transition);

}

.remaining-badge i{

    font-size:12px;

}


/* ==========================================================
   COUNTDOWN TITLE
========================================================== */

.countdown-header{

    margin-bottom:10px;

}

.countdown-title{

    display:flex;

    align-items:center;

    justify-content:center;

    gap:2px;

    font-weight:500;

    color:var(--dark);

    font-size:12px;

}

.countdown-title i{

    color:var(--primary);

}


/* ==========================================================
   COUNTDOWN GRID
========================================================== */

.countdown-grid{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:5px;

    margin-bottom:5px;

}


/* ==========================================================
   COUNTDOWN CARD
========================================================== */

.countdown-card{

    background:#ffffff;

    border:1px solid var(--border);

    border-radius:18px;

    padding:10px 6px;

    text-align:center;

    box-shadow:var(--shadow-sm);

    transition:var(--transition);

}

.countdown-card:hover{

    transform:translateY(-4px);

    box-shadow:var(--shadow-md);

}

.countdown-card h2{

    font-size:20px;

    font-weight:600;

    color:var(--primary);

    margin-bottom:6px;

    line-height:1;

}

.countdown-card small{

    font-size:12px;

    color:var(--gray);

}


/* ==========================================================
   PROGRESS SECTION
========================================================== */

.progress-section{

    display:flex;

    justify-content:center;

    align-items:center;

    margin:15px 0;

}

.progress-wrapper{

    display:flex;

    justify-content:center;

    align-items:center;

}


/* ==========================================================
   PROGRESS CIRCLE
========================================================== */

.progress-circle{

    position:relative;

    width:140px;

    height:140px;

}

.progress-circle svg{

    width:140px;

    height:140px;

    transform:rotate(-90deg);

}


/* ==========================================================
   SVG TRACK
========================================================== */

.progress-track{

    fill:none;

    stroke:#e5e7eb;

    stroke-width:10;

}


/* ==========================================================
   SVG PROGRESS
========================================================== */

.progress-bar{

    fill:none;

    stroke:url(#progressGradient);

    stroke-width:10;

    stroke-linecap:round;

    stroke-dasharray:214;

    stroke-dashoffset:214;

    transition:
        stroke-dashoffset
        .8s ease;

}


/* ==========================================================
   PERCENTAGE
========================================================== */

.progress-percent{

    position:absolute;

    top:50%;

    left:50%;

    transform:translate(-50%,-50%);

    display:flex;

    align-items:center;

    justify-content:center;

    width:86px;

    height:86px;

    border-radius:50%;

    background:#ffffff;

    box-shadow:var(--shadow-sm);

    font-size:24px;

    font-weight:700;

    color:var(--primary);

}


/* ==========================================================
   PROGRESS INFORMATION
========================================================== */

.progress-information{

    margin-top:24px;

}

.info-card{

    display:flex;

    gap:14px;

    align-items:flex-start;

    padding:16px;

    border-radius:18px;

    background:#f8fafc;

    border:1px solid var(--border);

}

.info-icon{

    width:46px;

    height:46px;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:50%;

    background:linear-gradient(
        135deg,
        #16a34a,
        #22c55e
    );

    color:#ffffff;

    font-size:18px;

    flex-shrink:0;

}

.info-content{

    flex:1;

}

.info-content strong{

    display:block;

    margin-bottom:6px;

    color:var(--dark);

    font-size:15px;

}

.info-content small{

    color:var(--gray);

    line-height:1.6;

    font-size:13px;

}

/* ==========================================================
   TIMELINE SECTION
========================================================== */

.timeline-section{

    margin-top:28px;
    margin-bottom:24px;

}

.section-heading{

    margin-bottom:16px;

}

.section-heading h6{

    font-size:16px;
    font-weight:700;
    color:var(--dark);
    text-align:center;

}


/* ==========================================================
   TIMELINE WRAPPER
========================================================== */

.timeline-wrapper{

    overflow:hidden;

}

.timeline{

    list-style:none;

    display:flex;

    justify-content:space-between;

    align-items:flex-start;

    position:relative;

    gap:10px;

}


/* garis timeline */

.timeline::before{

    content:"";

    position:absolute;

    top:18px;

    left:8%;

    width:84%;

    height:4px;

    background:#e5e7eb;

    border-radius:20px;

    z-index:0;

}


/* ==========================================================
   ITEM
========================================================== */

.timeline-item{

    position:relative;

    z-index:2;

    flex:1;

    display:flex;

    flex-direction:column;

    align-items:center;

    text-align:center;

}


/* ==========================================================
   DOT
========================================================== */

.timeline-dot{

    width:38px;

    height:38px;

    border-radius:50%;

    display:flex;

    align-items:center;

    justify-content:center;

    background:#d1d5db;

    color:#ffffff;

    margin-bottom:5px;

    transition:var(--transition);

    box-shadow:var(--shadow-sm);

}

.timeline-dot i{

    font-size:13px;

}


/* ==========================================================
   LABEL
========================================================== */

.timeline-item span{

    font-size:10px;

    font-weight:500;

    color:var(--gray);

    line-height:1.0;

}


/* ==========================================================
   ACTIVE
========================================================== */

.timeline-item.active .timeline-dot{

    background:linear-gradient(
        135deg,
        #2563eb,
        #0ea5e9
    );

    transform:scale(1.0);

    box-shadow:
        0 0 0 6px rgba(37,99,235,.15),
        var(--shadow-md);

}

.timeline-item.active span{

    color:var(--primary);

}


/* ==========================================================
   DONE
========================================================== */

.timeline-item.done .timeline-dot{

    background:linear-gradient(
        135deg,
        #22c55e,
        #16a34a
    );

}

.timeline-item.done span{

    color:#16a34a;

}


/* ==========================================================
   WAITING
========================================================== */

.timeline-item.waiting .timeline-dot{

    background:#d1d5db;

}

.timeline-item.waiting span{

    color:#9ca3af;

}


/* ==========================================================
   MESSAGE SECTION
========================================================== */

.message-section{

    margin-top:26px;

}

.spmb-message{

    margin-top:5px;

    padding:5px;

    border-radius:18px;

    background:#f8fafc;

    border:1px solid var(--border);

    font-size:12px;

    line-height:1.0;

    color:#374151;

    white-space:pre-line;

    transition:var(--transition);

}

.spmb-message:hover{

    border-color:#cbd5e1;

}


/* ==========================================================
   ACTION SECTION
========================================================== */

.action-section{

    margin-top:24px;

}


/* area tombol */

.action-area{

    display:flex;

    flex-direction:column;

    gap:12px;

}


/* tombol utama */

.action-area .btn{

    width:100%;

    border-radius:16px;

    padding:14px 18px;

    font-size:15px;

    font-weight:700;

    border:none;

    cursor:pointer;

    transition:var(--transition);

}


/* tombol bootstrap */

.action-area .btn-primary{

    background:linear-gradient(
        135deg,
        #2563eb,
        #0d6efd
    );

    color:#ffffff;

}

.action-area .btn-primary:hover{

    transform:translateY(-3px);

    box-shadow:var(--shadow-md);

}


/* tombol secondary */

.action-area .btn-secondary{

    background:#e5e7eb;

    color:#4b5563;

}

.action-area .btn-secondary:hover{

    background:#d1d5db;

}


/* ==========================================================
   FOOTER INFORMATION
========================================================== */

.widget-information{

    margin-top:26px;

}

.widget-information-box{

    display:flex;

    align-items:flex-start;

    gap:14px;

    padding:16px;

    border-radius:18px;

    background:#f8fafc;

    border:1px solid var(--border);

}

.widget-information-icon{

    width:46px;

    height:46px;

    display:flex;

    justify-content:center;

    align-items:center;

    border-radius:50%;

    background:linear-gradient(
        135deg,
        #0ea5e9,
        #2563eb
    );

    color:#ffffff;

    flex-shrink:0;

}

.widget-information-content{

    flex:1;

}

.widget-information-content strong{

    display:block;

    margin-bottom:6px;

    font-size:15px;

    color:var(--dark);

}

.widget-information-content p{

    font-size:13px;

    line-height:1.7;

    color:var(--gray);

}


/* ==========================================================
   FOOTER
========================================================== */

.widget-footer{

    margin-top:24px;

    padding-top:18px;

    border-top:1px solid var(--border);

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:10px;

}

.widget-footer-content small{

    color:var(--gray);

    line-height:1.6;

}

.widget-version{

    display:inline-flex;

    align-items:center;

    justify-content:center;

    padding:6px 12px;

    border-radius:999px;

    background:#eff6ff;

    color:var(--primary);

    font-size:12px;

    font-weight:700;

}


/* ==========================================================
   MOBILE CLOSE BUTTON
========================================================== */

.mobile-close-widget{

    display:none;

    position:absolute;

    top:17px;

    right:68px;

    width:42px;

    height:42px;

    border:none;

    border-radius:50%;

    background:rgba(255,255,255,.15);

    color:#ffffff;

    cursor:pointer;

    transition:var(--transition);

}

.mobile-close-widget:hover{

    transform:rotate(90deg);

    background:rgba(255,255,255,.30);

}

/* ==========================================================
   RESPONSIVE - LARGE DESKTOP
========================================================== */

@media (min-width:1600px){

    .spmb-widget{

        width:420px;

    }

}


/* ==========================================================
   RESPONSIVE - LAPTOP
========================================================== */

@media (max-width:1200px){

    .spmb-widget{

        width:360px;

    }

}


/* ==========================================================
   RESPONSIVE - TABLET
========================================================== */

@media (max-width:768px){

    .spmb-overlay{

        inset:0;

        padding:16px;

        justify-content:center;

        align-items:center;

    }

    .spmb-widget{

        width:100%;

        max-width:430px;

        max-height:92vh;

        overflow-y:auto;

        border-radius:24px;

    }

    .countdown-grid{

        gap:10px;

    }

    .countdown-card{

        padding:14px 6px;

    }

    .countdown-card h2{

        font-size:20px;

    }

    .progress-circle{

        width:100px;

        height:100px;

    }

    .progress-circle svg{

        width:80px;

        height:80px;

    }

    .progress-percent{

        width:50px;

        height:50px;

        font-size:10px;

    }

    .timeline{

        gap:4px;

    }

    .timeline-item span{

        font-size:10px;

    }

    .mobile-close-widget{

        display:flex;

        align-items:center;

        justify-content:center;

    }

}


/* ==========================================================
   RESPONSIVE - MOBILE
========================================================== */

@media (max-width:576px){

    .spmb-overlay{

        padding:12px;

    }

    .spmb-widget{

        width:100%;

        max-width:none;

        border-radius:20px;

    }

    .spmb-header{

        padding:16px;

    }

    .spmb-logo{

        width:46px;

        height:46px;

        font-size:20px;

    }

    .spmb-heading h5{

        font-size:17px;

    }

    .spmb-body{

        padding:16px;

    }

    .countdown-grid{

        grid-template-columns:
        repeat(2,1fr);

    }

    .timeline{

        overflow-x:auto;

        justify-content:flex-start;

        padding-bottom:8px;

    }

    .timeline::-webkit-scrollbar{

        display:none;

    }

    .timeline-item{

        min-width:72px;

    }

    .widget-footer{

        flex-direction:column;

        text-align:center;

    }

}


/* ==========================================================
   HEADER COLOR THEMES
========================================================== */

.spmb-header.spmb-green{

    background:linear-gradient(
        135deg,
        #16a34a,
        #22c55e
    );

}

.spmb-header.spmb-yellow{

    background:linear-gradient(
        135deg,
        #f59e0b,
        #facc15
    );

    color:#111827;

}

.spmb-header.spmb-blue{

    background:linear-gradient(
        135deg,
        #2563eb,
        #0ea5e9
    );

}

.spmb-header.spmb-purple{

    background:linear-gradient(
        135deg,
        #7c3aed,
        #9333ea
    );

}


/* ==========================================================
   ANIMATION
========================================================== */

@keyframes widgetFade{

    from{

        opacity:0;

        transform:
        translateY(40px)
        scale(.95);

    }

    to{

        opacity:1;

        transform:
        translateY(0)
        scale(1);

    }

}

@keyframes pulse{

    0%{

        transform:scale(1);

    }

    50%{

        transform:scale(1.08);

    }

    100%{

        transform:scale(1);

    }

}

@keyframes float{

    0%{

        transform:translateY(0);

    }

    50%{

        transform:translateY(-6px);

    }

    100%{

        transform:translateY(0);

    }

}

@keyframes shimmer{

    0%{

        background-position:-300px 0;

    }

    100%{

        background-position:300px 0;

    }

}


/* ==========================================================
   EFFECTS
========================================================== */

.timeline-item.active .timeline-dot{

    animation:pulse 1.5s infinite;

}

.remaining-badge{

    animation:float 3s ease-in-out infinite;

}

.progress-circle{

    animation:widgetFade .8s ease;

}


/* ==========================================================
   ACCESSIBILITY
========================================================== */

.widget-toggle:focus-visible,
.mobile-close-widget:focus-visible,
.action-area .btn:focus-visible{

    outline:3px solid rgba(37,99,235,.35);

    outline-offset:3px;

}

@media (prefers-reduced-motion:reduce){

    *,
    *::before,
    *::after{

        animation:none !important;

        transition:none !important;

        scroll-behavior:auto !important;

    }

}


/* ==========================================================
   DARK MODE
========================================================== */

@media (prefers-color-scheme:dark){

    .spmb-widget{

        background:#111827;

        color:#f9fafb;

    }

    .spmb-body{

        background:#111827;

    }

    .server-clock,
    .countdown-card,
    .info-card,
    .widget-information-box,
    .spmb-message{

        background:#1f2937;

        border-color:#374151;

    }

    .section-heading h6,
    .info-content strong,
    .widget-information-content strong,
    #serverClock{

        color:#ffffff;

    }

    .widget-footer{

        border-color:#374151;

    }

}


/* ==========================================================
   UTILITIES
========================================================== */

.is-hidden{

    display:none !important;

}

.is-disabled{

    opacity:.65;

    pointer-events:none;

}

.text-center{

    text-align:center;

}

.mt-0{

    margin-top:0;

}

.mb-0{

    margin-bottom:0;

}

.w-100{

    width:100%;

}


/* ==========================================================
   FIX MINIMIZE UNTUK MOBILE & DESKTOP
========================================================== */
.spmb-widget.is-minimized {
    max-height: auto !important;
    overflow: hidden;
}

@media (max-width: 768px) {
    .spmb-widget.is-minimized {
        width: 280px; /* Lebar minimal panel header saat mengecil di HP */
        max-width: calc(100vw - 40px);
    }
}