﻿/* Basic modal/backdrop */
.imdt-modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    z-index: 1050;
}

    .imdt-modal-backdrop.show {
        display: flex;
    }

.imdt-modal {
    width: 95%;
    max-width: 820px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    overflow: hidden;
}

/* header */
.imdt-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid #eee;
}

.imdt-logo {
    width: 140px;
    display: block;
}

.imdt-modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    flex: 1;
    margin-left: 20rem;
}

.imdt-close {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
    color: #f6f7f8;
    font-weight:bolder;
}

/* body */
.imdt-modal-body {
    padding: 18px 22px;
}

.imdt-subtitle {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 12px;
}

/* buttons */
.imdt-btn, .imdt-start-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    background: var(--primary);
    color: var(--secondary-color);
}

    .imdt-start-btn[disabled],
    .imdt-start-btn.disabled {
        opacity: 0.65;
        cursor: default;
    }

/* loader & spinner */
.hidden {
    display: none !important;
}

.imdt-loader {
    text-align: center;
    margin: 16px 0;
}

.imdt-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: imdtSpin 1s linear infinite;
    margin: 0 auto;
}

@keyframes imdtSpin {
    0% {
        transform: rotate(0)
    }

    100% {
        transform: rotate(360deg)
    }
}

/* results */
.imdt-results-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

    .imdt-results-list li {
        padding: 10px 0;
        border-bottom: 1px dashed #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: var(--secondary-color);
    }

.imdt-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

.imdt-result-card {
    margin-top: 10px;
    padding: 14px;
    border-left: 5px solid var(--primary);
    border-radius: 6px;
    background: #fff;
    font-weight: 600;
}

/* verdict colours */
.status-good {
    background-color: #d4edda;
    border-color: var(--success);
    color: var(--success);
}

.status-warn {
    background-color: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

.status-bad {
    background-color: #f8d7da;
    border-color: var(--danger);
    color: var(--danger);
}

/* footer */
.imdt-modal-footer {
    padding: 12px 22px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray);
}

/* responsive */
@media (max-width:480px) {
    .imdt-logo {
        width: 100px;
    }

    .imdt-modal {
        margin: 12px;
    }
}
/* Summary styling */
.imdt-tips-summary {
    /*    color: black;*/
    color: var(--secondary-color);
    margin-top: 5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--dark-color2);
}

    /* Remove default browser marker */
    .imdt-tips-summary::marker {
        content: "";
    }

details summary {
    list-style: none;
}

/* Custom arrow */
.imdt-tips-summary::before {
    content: "▸";
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 1.5rem;
    color: var(--secondary-color);
}

/* Rotate arrow when open */
details[open] > .imdt-tips-summary::before {
    transform: rotate(90deg);
}

/* List styling */
.imdt-tips-list,
.imdt-tips-list li {
    color: var(--secondary-color);
    margin-top: 4px;
    font-size: 0.95rem;
}

/* Spacing when expanded */
details[open] .imdt-tips-list {
    margin-top: 8px;
}
/* Limit modal height relative to viewport */
.imdt-modal {
    max-height: 90vh; /* modal never exceeds viewport */
    display: flex;
    flex-direction: column; /* stack header + body */
}

/* Keep header fixed, non-scrollable */
.imdt-modal-header {
    flex-shrink: 0;
    background-color: var(--dark-color2);
}

/* Make only the body scroll */
.imdt-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 12px; /* space for scrollbar */
    padding: 0.3rem 0.5rem;
    background-color: var(--card-bg-color) !important;
}

    /* Optional: nicer scrollbar (WebKit browsers) */
    .imdt-modal-body::-webkit-scrollbar {
        width: 8px;
    }

/* IMDT modal quick guide styles */
.imdt-guide {
    margin-top: 12px;
    color: var(--secondary-color);
    font-size: 0.95rem;
    line-height: 1.45;
    padding-right: 1.5rem !important;
    padding-left: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

    .imdt-guide h4 {
        margin: 6px 0;
        font-size: 1rem;
        color: var(--secondary-color);
    }

.imdt-guide-list {
    margin: 8px 0 12px 0;
    padding-left: 18px;
    color: #000;
}

    .imdt-guide-list li {
        margin-bottom: 8px;
        color: var(--secondary-color);
    }

.imdt-action-list {
    margin: 6px 0 12px 18px;
    color: var(--secondary-color);
}

    .imdt-action-list li {
        margin-bottom: 8px;
    }

.imdt-guide-note {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}
/* Tooltip basics */
.imdt-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .imdt-results-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        position: relative;
    }

/* label area */
.imdt-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* help button */
.imdt-help {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: #e9eef6;
    color: #0b3a66;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .imdt-help:focus {
        outline: 2px solid #7da8df;
        outline-offset: 2px;
    }

/* tooltip panel */
.imdt-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 1200;
    min-width: 200px;
    max-width: 320px;
    background: #0b2540;
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    margin-top: 8px;
    box-shadow: 0 6px 20px rgba(11,37,64,0.35);
    font-size: 13px;
    line-height: 1.3;
}

    /* little arrow */
    .imdt-tooltip::after {
        content: "";
        position: absolute;
        top: -6px;
        left: 12px;
        border-width: 6px;
        border-style: solid;
        border-color: transparent transparent #0b2540 transparent;
    }

/* show on hover & focus */
.imdt-help:hover + .imdt-tooltip,
.imdt-help:focus + .imdt-tooltip,
.imdt-help[aria-expanded="true"] + .imdt-tooltip {
    display: block;
}

/* make sure tooltip doesn't push layout on small screens */
@media (max-width: 480px) {
    .imdt-tooltip {
        left: 0;
        right: 0;
        min-width: unset;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
}
.imdt-score-mobile-warning {
    margin-top: 0.5rem;
    font-weight: 600;
    color: #8b0000;
}