﻿/* ================================
   ENTERPRISE MODAL (compact + centered)
   ================================ */

/* Overlay: The Container */
.aks-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    /* Using Flex is often more reliable for scrollable overlays */
    display: none; /* JS will change this to 'grid' or 'flex' */
    place-items: center;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, .55);
    backdrop-filter: blur(2px);
    overflow-y: auto;
    /* Apply the fade-in animation */
    animation: overlayFade 0.25s ease-out forwards;
}



/* Modal: The Box */
.aks-modal {
    width: min(500px, 100%);
    position: relative; /* Better than margin for centering in grids */
    max-height: calc(100dvh - 64px);
    height: max-content;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(2,6,23,.22), 0 2px 10px rgba(2,6,23,.10);
    overflow: hidden;
    /* Apply the scale/pop animation */
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    
    
}

/* --- Animations --- */

@keyframes overlayFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


.aks-modal.aks-modal-info {
    width: min(500px, 100%);
    justify-self: center;
    align-self: center;
}


/* Header */
.aks-modal-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, .10);
    background: rgba(248, 250, 252, .75);
}

.aks-modal-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(15, 23, 42, .05);
    border: 1px solid rgba(15, 23, 42, .10);
    flex: 0 0 auto;
}

#infoModalIcon {
    font-size: 16px;
    line-height: 1;
}

.aks-modal-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    color: #0f172a;
    letter-spacing: .1px;
}

.aks-modal-close {
    background: transparent;
    color: rgba(15, 23, 42, .65);
    cursor: pointer;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

    .aks-modal-close:hover {
        color: #0f172a;
    }

    .aks-modal-close:active {
        transform: translateY(1px);
    }

/* Body (scroll lives here) */
.aks-modal-body {
    overflow: auto;
    width: 100%;
}


/* If you keep this class in markup, it should not fight sizing */
.aks-modal-body-scroll {
    max-height: none;
}

.aks-modal-description {
    margin: 0 0 12px 0;
    color: rgba(15, 23, 42, .70);
    font-size: 14px;
    line-height: 1.5;
}

/* Footer */
.aks-modal-footer {
    width: 100%;
    padding: 1rem 2rem;
    border-top: 1px solid rgba(15, 23, 42, .10);
    display: flex;
    gap: 10px;
    
    justify-content: flex-end;
    background: rgba(248, 250, 252, .75);
   
}

/* Inputs */
.aks-input-label {
    margin-bottom: 6px;
    font-weight: 600;
    color: rgba(15, 23, 42, .78);
    font-size: 13px;
}

.aks-input-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, .16);
    border-radius: 10px;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .aks-input-field:focus {
        outline: none;
        border-color: rgba(59, 130, 246, .65);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
    }

/* Buttons */
.aks-btn {
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 650;
    font-size: 14px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
    border: none;
}

    .aks-btn:active {
        transform: translateY(1px);
    }

.aks-btn-primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

    .aks-btn-primary:hover {
        background: #1d4ed8;
    }

.aks-btn-secondary {
    background: rgba(15, 23, 42, .05);
    color: rgba(15, 23, 42, .82);
    border: 1px solid rgba(15, 23, 42, .12);
}

    .aks-btn-secondary:hover {
        background: rgba(15, 23, 42, .07);
        border-color: rgba(15, 23, 42, .16);
    }

/* Error */
.aks-error-message {
    padding: 10px 12px;
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .22);
    border-radius: 10px;
    color: rgba(127, 29, 29, .95);
    font-size: 13px;
    margin-top: 10px;
}

/* Animations */
@keyframes modalPop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile */
@media (max-width: 520px) {
    .aks-modal-overlay {
        padding: 10px;
    }

    .aks-modal {
        max-height: 86dvh;
    }
}

/* ================================
   INFO CONTENT STYLES
   ================================ */
.aks-info-content {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(15, 23, 42, .82);
}

.aks-info-section {
    margin-bottom: 16px;
}

    .aks-info-section:last-child {
        margin-bottom: 0;
    }

.aks-info-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: .1px;
}

.aks-info-icon {
    font-size: 16px;
    line-height: 1;
    opacity: .85;
}

.aks-info-content p {
    margin: 0 0 10px 0;
}

.aks-info-example {
    background: rgba(248, 250, 252, .9);
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 10px 0;
}

.aks-info-example-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(15, 23, 42, .55);
    margin-bottom: 6px;
}

.aks-info-example-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.aks-info-before {
    color: rgba(15, 23, 42, .65);
}

.aks-info-arrow {
    color: rgba(37, 99, 235, .85);
    font-weight: 800;
}

.aks-info-after {
    color: rgba(15, 23, 42, .92);
    font-weight: 800;
}

.aks-info-example-note {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(2, 132, 199, .95);
    font-style: normal;
}

.aks-formula-table {
    margin: 10px 0 0;
}

.aks-formula-category {
    margin: 12px 0 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(15, 23, 42, .12);
    color: rgba(15, 23, 42, .85);
}

.aks-formula-item {
    display: grid;
    grid-template-columns: 160px 24px 1fr;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13.5px;
}

.aks-formula-from {
    color: rgba(15, 23, 42, .60);
}

.aks-formula-equals {
    color: rgba(15, 23, 42, .35);
    font-weight: 900;
}

.aks-formula-to {
    color: rgba(15, 23, 42, .90);
    font-weight: 650;
}

@media (max-width: 560px) {
    .aks-formula-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .aks-formula-equals {
        display: none;
    }
}

.aks-info-tips {
    margin: 8px 0 0;
    padding-left: 18px;
}

    .aks-info-tips li {
        margin-bottom: 6px;
    }

        .aks-info-tips li:last-child {
            margin-bottom: 0;
        }




/* Container for the buttons */
#inputModalPresets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* The individual buttons */
.aks-preset-btn {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .aks-preset-btn:hover {
        background: rgba(15, 23, 42, 0.08);
        border-color: rgba(15, 23, 42, 0.2);
        transform: translateY(-1px);
    }

    .aks-preset-btn:active {
        transform: translateY(0);
    }