:root {
    --hue: 223;
    --sat: 10%;
    --bg: hsl(var(--hue), var(--sat), 90%);
    --fg: hsl(var(--hue), var(--sat), 10%);
    --hue-success: 126;
    --success1: hsl(var(--hue-success), 90%, 40%);
    --success2: hsl(var(--hue-success), 90%, 24%);
    --periwinkle: hsl(240, 90%, 70%);
    --light-blue: hsl(210, 90%, 70%);
    --orange: hsl(15, 90%, 70%);
    --magenta: hsl(300, 90%, 70%);
    --light-green: hsl(105, 40%, 70%);
    --light-teal: hsl(150, 40%, 70%);
    --purple: hsl(270, 90%, 70%);
    --trans-dur: 0.3s;
}

.success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    font-family: 'Poppins', sans-serif;
}

.success-modal {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    height: auto;
    max-height: 90vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    transform: scale(0.98);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(0.98);
    }
}

.modal-header {
    padding: 2.5rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    background: linear-gradient(135deg, hsl(228, 67%, 98%), white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header h3 {
    color: hsl(228, 57%, 28%);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
    letter-spacing: -0.02em;
}

.modal-body {
    padding: 2rem 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: hsl(228, 67%, 98%);
    border-radius: 12px;
    font-size: 0.90em;
    align-items: center;
    min-height: 48px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-label {
    font-weight: 600;
    color: #4a5568;
    margin-right: 0.75rem;
}

.detail-value {
    color: #2d3748;
    font-weight: 500;
    text-align: left;
    word-break: break-word;
    max-width: 60%;
}

.detail-item-pay-later {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: 15px;
    background: hsl(228, 67%, 98%);
    border-radius: 12px;
    font-size: 0.90em;
    align-items: center;
    min-height: 48px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-item-pay-later svg {
    flex-shrink: 0;
    /* Prevent icon from shrinking */
    margin-right: 15px;
    color: hsl(227, 67%, 47%);
}

.detail-text-pay-later {
    flex-grow: 1;
    margin-top: 2px;
}

.detail-text-pay-later p {
    margin: 0;
    line-height: 1.5;
}

.data-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: hsl(228, 67%, 98%);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.data-section h3 {
    margin: 0 0 1.25rem 0;
    color: #2b6cb0;
    font-size: 1.15em;
    font-weight: 700;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    background: #e3f2fd;
    color: #2b6cb0;
    padding: 0.5rem 1.25rem;
    border-radius: 24px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(43, 108, 176, 0.1);
}

.tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(43, 108, 176, 0.1);
}

.countdown {
    text-align: center;
    color: #4a5568;
    margin: 1.5rem 0 0.5rem;
    font-size: 0.85em;
    font-weight: 500;
}

#countdown {
    color: #2b6cb0;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: hsl(228, 67%, 98%);
}

.bx-download {
    font-size: 21px;
    margin-right: 5px;
}

.download-btn,
.close-modal-btn {
    font-family: 'Poppins', sans-serif;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-btn {
    background: hsl(228, 67%, 47%);
    color: white;
    gap: 0.75rem;
}

.download-btn:hover {
    background: hsl(228, 67%, 42%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 144, 247, 0.2);
}

.close-modal-btn {
    background: white;
    color: #4a5568;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.close-modal-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #2d3748;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .success-modal {
        border-radius: 20px;
        max-width: 95%;
    }

    .modal-header {
        padding: 2rem 1rem 1rem;
    }

    .modal-header h3 {
        font-size: 1.3rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .detail-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .detail-value {
        text-align: left;
        max-width: 100%;
    }

    .data-section {
        padding: 1.25rem;
        margin: 1.5rem 0;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .download-btn,
    .close-modal-btn {
        width: 100%;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .success-modal-overlay {
        padding: 0;
    }

    .modal-body {
        padding: 1.5rem 1rem;
    }

    .tag {
        font-size: 0.85em;
        padding: 0.5rem 1rem;
    }

    .countdown {
        margin: 1.25rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.spinner {
    display: flex;
    font: 1em/1.5 sans-serif;
    color: var(--success2);
    overflow: visible;
    margin: auto;
    width: 3rem;
    height: auto;
    transition: color var(--trans-dur);
    margin-bottom: 1.5rem;
}

.spinner circle,
.spinner g,
.spinner path {
    animation-duration: 3.2s;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.spinner__check,
.spinner__pop-start,
.spinner__worm {
    transform-origin: 24px 24px;
}

.spinner__check {
    animation-name: check;
}

.spinner__pop-dot {
    animation-name: pop-dot;
}

.spinner__pop-dot-group {
    animation-name: pop-dot-group1;
}

.spinner__pop-dot-group+.spinner__pop-dot-group {
    animation-name: pop-dot-group2;
}

.spinner__pop-end {
    animation-name: pop-end;
}

.spinner__pop-start {
    animation-name: pop-start;
}

.spinner__worm {
    animation-name: worm;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: hsl(var(--hue), 90%, 10%);
        --fg: hsl(var(--hue), 90%, 90%);
    }

    .spinner {
        color: var(--success1);
    }
}

/* Animations */
@keyframes check {

    from,
    64% {
        stroke-dashoffset: -36.7;
        transform: scale(1);
    }

    75%,
    77% {
        animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
        stroke-dashoffset: 13.7;
        transform: scale(1);
    }

    79% {
        animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
        stroke-dashoffset: 13.7;
        transform: scale(0.4);
    }

    87% {
        animation-timing-function: cubic-bezier(0.32, 0, 0.67, 0);
        stroke-dashoffset: 13.7;
        transform: scale(1.4);
    }

    93%,
    to {
        stroke-dashoffset: 13.7;
        transform: scale(1);
    }
}

@keyframes pop-dot {

    from,
    80% {
        animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
        transform: translate(0, 6px);
    }

    90%,
    to {
        transform: translate(0, 0);
    }
}

@keyframes pop-dot-group1 {

    from,
    82.5%,
    90%,
    to {
        opacity: 0;
    }

    85%,
    87.5% {
        opacity: 1;
    }
}

@keyframes pop-dot-group2 {

    from,
    82.5%,
    to {
        opacity: 0;
    }

    85%,
    90% {
        opacity: 1;
    }
}

@keyframes pop-end {
    from {
        animation-timing-function: steps(1, end);
        opacity: 0;
        r: 18px;
        stroke-width: 4px;
    }

    82.5% {
        animation-timing-function: linear;
        opacity: 1;
        r: 18px;
        stroke-width: 4px;
    }

    84%,
    to {
        opacity: 0;
        r: 19px;
        stroke-width: 3px;
    }
}

@keyframes pop-start {
    from {
        animation-timing-function: steps(1, end);
        opacity: 0;
        transform: scale(0.35);
    }

    76% {
        animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
        opacity: 1;
        transform: scale(0.35);
    }

    82.5% {
        animation-timing-function: steps(1, start);
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(1);
    }
}

@keyframes worm {
    from {
        stroke-dashoffset: -51.84;
        transform: rotate(-119deg);
    }

    60% {
        stroke-dashoffset: -51.84;
        transform: rotate(961deg);
    }

    64% {
        animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);
        stroke-dashoffset: -51.84;
        transform: rotate(1033deg);
    }

    72.5%,
    to {
        stroke-dashoffset: -138.23;
        transform: rotate(1033deg);
    }
}


/* PREVENT BACK BUTTON BROWSER MODAL */

.unique-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.unique-dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Unique dialog box styling */
.unique-dialog-box {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 90%;
    width: 350px;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.unique-dialog-overlay.active .unique-dialog-box {
    transform: scale(1);
    opacity: 1;
}

.unique-dialog-box p {
    margin: 0 0 20px;
    font-size: 16px;
    color: #333;
}

/* Unique button styling */
.unique-dialog-confirm,
.unique-dialog-cancel {
    margin: 10px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    font-family: 'Poppins', sans-serif;
    flex: 1;
    /* Make buttons take equal width */
    box-sizing: border-box;
    /* Ensure padding is included in the width */
    text-align: center;
    /* Center the text inside the buttons */
}

.unique-dialog-confirm {
    background-color: hsl(228, 66%, 47%);
    color: white;
}

.unique-dialog-confirm:hover {
    background-color: hsl(228, 62%, 59%);
}

.unique-dialog-cancel {
    background-color: #f1f1f1;
    color: #333;
}

.unique-dialog-cancel:hover {
    background-color: #ddd;
}

/* Disable scrolling on the body when the modal is active */
.body-no-scroll {
    overflow: hidden;
}

/* END BROWSER DIALOG PREVENT */



