/* ==========================================================================
   Hype Token Calculator — Styles
   ========================================================================== */

/* ---------- Font ---------- */
@font-face {
    font-family: 'Digital-7';
    src: url('../fonts/digital-7.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ---------- Variables (easy to override per-theme) ---------- */
:root {
    --htc-bg: #1a1a2e;
    --htc-display-bg: #0f0f1a;
    --htc-btn-bg: #16213e;
    --htc-btn-hover: #1a2744;
    --htc-btn-border: #2a2a4a;
    --htc-text: #e0e0e0;
    --htc-text-muted: #8888aa;
    --htc-accent-green: #00e676;
    --htc-accent-red: #ff5252;
    --htc-accent-orange: #f5911c;

    --htc-accent-blue: #448aff;
    --htc-radius: 15px;
    --htc-big-radius: 25px;
    --htc-gap: 25px;
    --htc-max-width: 430px;
}

/* ---------- Calculator wrapper ---------- */
/* ---------- Wrapper ---------- */
.htc-wrapper {
    max-width: var(--htc-max-width);
    margin: 0 auto;
    font-family: 'Syne', 'Roboto', sans-serif;
    box-sizing: border-box;
}

.htc-wrapper *,
.htc-wrapper *::before,
.htc-wrapper *::after {
    box-sizing: inherit;
}

/* ---------- Day-type pill toggle (outside calculator) ---------- */
.htc-toggle {
    width: 90%;
    height: 70px;
    position: relative;
    display: flex;
    background: #000;
    border-radius: 50px;
    padding: 4px;
    margin: 15px auto;
}

.htc-toggle__slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #57FF9B;
    border: 1px solid #000;
    border-radius: 50px;
    transition: left 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.htc-toggle--weekend .htc-toggle__slider {
    left: calc(50%);
}

.htc-toggle__btn {
    flex: 1;
    position: relative;
    z-index: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: #fff;
    text-align: center;
    transition: color 0.3s;

    &:hover, &:focus {
        background: initial;
        color: #fff;
    }
}

.htc-toggle__btn--active {
    color: #000;
    &:hover, &:focus {
        background: initial;
        color: #000;
    }
}

/* ---------- Calculator ---------- */
.htc-calculator {
    position: relative;
    background: #000;
    border-radius: 40px;
    padding: 30px;
}

/* ---------- Token display ---------- */
.htc-display {
    background: linear-gradient(125deg, #D7E8E9 35%, #BBDADE 36%);
    border-radius: var(--htc-big-radius);
    height: 120px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.htc-display__inner{
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    border: 3px solid #000;
    border-radius: 15px;
    padding: 10px;
    overflow: hidden;
}

.htc-display__icon {
    width: 30px;
    align-self: flex-end;
    object-fit: contain;
}

.htc-display__value {
    font-family: 'Digital-7', monospace;
    font-size: 6rem;
    color: #000;
    line-height: .9;
}

/* ---------- Grid layout (3 cols × 4 rows) ---------- */
.htc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--htc-gap);
    margin-bottom: 10px;
}

/* ---------- Base button ---------- */
.htc-grid__btn {
    height: 80px;
    width: 100%;
    /* aspect-ratio: 1; */
    border: 2px solid #e8e8ee;
    border-radius: var(--htc-radius);
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.3);
    background: #16213e00;
    color: var(--htc-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    position: relative;
    transition: border-color 0.2s, background-color 0.2s, transform 0.1s;

    &:focus{
        background-color: initial !important;
    }
}

button.htc-grid__btn::after{
    /* content: '';
    display: block;
    width: 120%;
    height: 100%;
    background: linear-gradient(0deg, #0004 25%, #0001 100%);
    position: absolute;
    z-index: 999999; */
}


.htc-grid__btn:active {
    transform: scale(0.95);
}

/* ---------- Product buttons ---------- */
.htc-product-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    pointer-events: none;
}

/* Hide empty slots entirely */
.htc-product-btn--empty {
    visibility: hidden;
}

/* Green border when product has been added */
.htc-product-btn--added {
    border-color: var(--htc-accent-green);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.25);
}

/* Item title label */
.htc-product-btn__tokens {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: var(--htc-text);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 0 0 6px 6px;
    line-height: 1.3;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-transform: uppercase;
}

/* Quantity badge (shows how many times added) */
.htc-product-btn__qty {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--htc-accent-green);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* ---------- Tooltip (product name on neutral click) ---------- */
.htc-tooltip {
    position: absolute;
    transform: translate(-50%, -100%);
    background: #000;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.htc-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.htc-tooltip--visible {
    opacity: 1;
}

/* ---------- Next / pagination button ---------- */
.htc-next-btn {
    background: #263FF8 !important;
    color: #fff;

     &:hover, &:focus {
        background-color: #263FF8 !important;
        svg{
            stroke: #fff;
        }
    }

    & svg{
        stroke-width: 3.5;
        width: 35px;
        height: 35px;
        transition: transform 0.3s ease;
    }
}

/* Rotate arrow when on page 2 (back) */
.htc-next-btn--back svg {
    transform: rotate(180deg);
}

/* Hide next button when there is only one page */
.htc-next-btn--hidden {
    visibility: hidden;
}

/* ---------- Action buttons (row 4) ---------- */
.htc-action-btn {
    color: var(--htc-text-muted);
}

.htc-action-btn svg {
    transition: color 0.2s;
}

/* Add button */
.htc-action-btn--add svg{
    stroke: #56FF99;
    stroke-width: 3px;
    width: 35px;
    height: 35px;
}

.htc-action-btn--add.htc-action-btn--active {
    border-color: var(--htc-accent-green);
    color: var(--htc-accent-green);
    background: var(--htc-accent-green) !important;
    svg{
        stroke: #fff;
    }
}

/* Remove button */
.htc-action-btn--remove svg{
    stroke: #FF5252;
    stroke-width: 3px;
    width: 35px;
    height: 35px;
}

.htc-action-btn--remove.htc-action-btn--active {
    border-color: var(--htc-accent-red);
    color: var(--htc-accent-red);
    background: var(--htc-accent-red) !important;

    svg{
        stroke: #fff;
    }
}

/* View button */
.htc-action-btn--view {
    flex-direction: column;
    
    & span {
        color: #fff;
        font-weight: 600;
        font-size: 14px;
    }

    &:hover {
        background-color: #ffffff;
        border-color: #ffffff;
        
        span{
            color: #000;
        }
    }
}

.htc-action-btn--view svg {
    stroke: #448aff;
    stroke-width: 3px;
    width: 35px;
    height: 35px;
}

.htc-action-btn--view.htc-action-btn--active {
    border-color: var(--htc-accent-orange);
    background: var(--htc-accent-orange) !important;

    svg{
        stroke: #fff;
    }

    &:hover {
        span{
            color: #fff!important;
        }
    }
}

@media (max-width: 768px) {
    .htc-action-btn--view {
        display: flex;
    }
    .htc-modal .htc-modal__close {
        top: -60px;
        right: -15px; 
    }
    .htc-popup{
        .htc-popup__subtitle{
            font-size: 22px;
        }
        .htc-popup__title {
            font-size: 35px;
        }

        .htc-popup__tokens-per-container {
            margin-bottom: 10px;
            
            .htc-popup__tokens-text {
                font-size: 18px;
            }
            img {
                width: 35px;
            }
        }
        .htc-popup__tokens-row {
            .htc-popup__tokens-row-value-container img{
                width:25px;
            }

            .htc-popup__tokens-value {
                font-size:35px;
            }
            .htc-popup__tokens-label {
                font-size: 10px;
            }
        }
        .htc-popup__info {
            padding: 20px 15px;
        }

    }
    
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 480px) {
    :root {
        --htc-max-width: 100%;
    }
}

@media (max-width: 400px) {
    .htc-action-btn{
        margin: 5px;
    }
    .htc-popup__tokens-container{
        margin-left: 45px !important;
    }
}

/* ---------- Info trigger ---------- */
.htc-info-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px auto 12px;
    background: #263FF8;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 30px;
    transition: opacity 0.2s;
}

.htc-info-trigger__icon {
    flex-shrink: 0;
}

/* ---------- Instructions modal ---------- */
.htc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.htc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.htc-modal__content {
    position: relative;
    background: #1a1a2e;
    border: 2px solid #2a2a4a;
    border-radius: 20px;
    padding: 30px 25px;
    max-width: 400px;
    width: 90%;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    z-index: 1;
}

.htc-modal__close{
    position: absolute;
    top: -55px;
    right: -55px;
    background: #fff;
    border: none;
    color: #000;
    font-size: 30px;
    cursor: pointer;
    opacity: 0.8;
    padding: 12px 20px;
    border-radius: 50%;

    &:hover {
        background: red;
        color: #fff;
    }
}

.htc-modal__intro {
    margin: 0 0 20px;
    font-weight: 600;
}

.htc-modal__step {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    align-items: flex-start;

    &:last-child {
        flex-direction: column;
        align-items: flex-start;
    }
}

.htc-modal__step-num {
    background: #57FF9B;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.htc-modal__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.htc-modal__list li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.htc-modal__inline-icon {
    flex-shrink: 0;
    vertical-align: middle;
}

/* ---------- Product detail popup (view mode — modal style) ---------- */
.htc-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.htc-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.htc-popup__content {
    position: relative;
    background: #000;
    border: 10px solid #000;
    border-radius: 50px 0px 50px 50px;
    border-top-right-radius: 0;
    max-width: 450px;
    width: 100%;
    z-index: 1;
    padding: 30px;
    /* overflow: hidden; */
}

.htc-popup__close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #2323E6;
    border: 7px solid #000;
    color: #fff;
    font-size: 50px;
    cursor: pointer;
    opacity: 1;
    padding: 5px 20px;
    border-radius: 0;
    z-index: 2;

    &:hover {
        background: red;
        color: #fff;
        border-color: #000;
    }
}

.htc-popup__body {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.htc-popup__image {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.htc-popup__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
}

.htc-popup__info {
    padding: 20px 25px;
    padding-bottom: 50px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
}

.htc-popup__subtitle {
    margin: 0 !important;
    font-size: 25px;
    font-weight: 100;
    color: #FF00FF;
    font-family: "Amazing views", Sans-serif;
}

.htc-popup__title {
    margin: 0 !important;
    font-size: 3rem;
    line-height: 0.8em;
    font-weight: 100;
    color: #fff;
    text-transform: uppercase;
    font-family: "Amazing views", Sans-serif;
}

.htc-popup__tokens {
    width: 100%;
    margin-top: 15px;
}

.htc-popup__tokens-container {
    width: 100%;
    margin-left: 60px;
    display: flex;
}

.htc-popup__tokens-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: #ccc;
    font-size: 14px;
    width: 100%;
}

.htc-popup__tokens-row-value-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.htc-popup__tokens-per-container{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center; 
    gap: 10px;

    p {
        margin: 0 !important;
        text-align: left;
        font-size: 25px;
        font-weight: 100;
        font-family: "Amazing views", Sans-serif;
    }
}


.htc-popup__cal-icon {
    flex-shrink: 0;
    stroke: #fff;
    width: 40px;
    height: 40px;
}

.htc-popup__tokens-label {
    /* flex: 1;
    text-align: left; */
    font-weight: 700;
    font-size: 12px;
}

.htc-popup__tokens-value {
    font-weight: 400;
    color: #fff;
    font-size: 40px;
    font-family: "Amazing views", Sans-serif;
}
