/* ── BASE STYLES ───────────────────────────────────────────── */
body, html {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    background-color: #eef2f6;
    color: #333;
}

/* ── HEADER ─────────────────────────────────────────────────── */
header {
    background-color: #0047ab;
    color: white;
    text-align: center;
    padding: 1rem;
}

/* ── MAIN CONTENT & CONTAINER ─────────────────────────────── */
main {
    padding: 2rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
}

/* ── FORM ELEMENTS ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

    .form-group label {
        display: block;
        font-weight: bold;
        margin-bottom: 0.5rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
        border: 1px solid #ccd6e0;
        border-radius: 8px;
        background-color: white;
        color: #333;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
        resize: none;
    }

/* ── BUTTONS ─────────────────────────────────────────────────── */
button {
    display: inline-block;
    background-color: #0047ab;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    button:hover {
        background-color: #003b8b;
        transform: translateY(-2px);
    }

    button:active {
        transform: translateY(0);
    }

/* ── FOOTER ─────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 1rem;
    background-color: #f1f1f1;
    margin-top: 2rem;
}

/* ── COLLAPSIBLE ITEMS ─────────────────────────────────────── */
.collapsible-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    overflow: hidden;
}

.collapsible-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

    .collapsible-header:hover {
        background-color: #e9ecef;
    }

.collapsible-content {
    padding: 15px;
    background-color: #f9f9f9;
    display: none;
}

/* ── SIDEBAR NAVIGATION ────────────────────────────────────── */
.pcoded-navbar {
    font-size: 0.85em;
}

    .pcoded-navbar .pcoded-micon {
        font-size: 1em;
    }

    .pcoded-navbar .pcoded-mtext {
        font-size: 0.85em;
    }

.pcoded-navigatio-lavel {
    font-size: 0.9em;
    font-weight: bold;
    color: #6c757d;
}

.pcoded-item .pcoded-left-item li {
    padding: 8px 12px;
}

@media (max-width: 768px) {
    .pcoded-navbar {
        font-size: 0.75em;
    }

        .pcoded-navbar .pcoded-mtext {
            font-size: 0.75em;
        }

    .pcoded-navigatio-lavel {
        font-size: 0.8em;
    }
}

/* ── SEARCH CONTAINER & BOX ─────────────────────────────────── */
.search-container, #search-results {
    max-width: 1450px;
    width: 100%;
    margin: 0 auto;
    text-align: left;
}

#search-box {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
}

#search-results {
    display: none;
}

@media (max-width: 768px) {
    .search-container, #search-results {
        max-width: 100%;
        padding: 10px;
    }
}

/* ── PROBLEM STATEMENT ─────────────────────────────────────── */
#problem-statement {
    padding: 10px;
    font-size: 0.9rem;
    border: 1px solid #ccd6e0;
    border-radius: 8px;
    background-color: white;
    color: #333;
    resize: none;
}

    #problem-statement::placeholder {
        color: #aaa;
    }

/* ── CLOSE BUTTON ───────────────────────────────────────────── */
.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

    .close:hover {
        color: red;
    }

/* ── GENERAL ELEMENTS ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6, p, button, input, textarea {
    font-family: 'Poppins', sans-serif;
}

/* ── NOUN PHRASE TAGS ─────────────────────────────────────────── */
.tag {
    display: flex;
    align-items: center;
    background-color: #0047ab;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    height: 24px;
    line-height: 20px;
}

    .tag:hover {
        background-color: #003b8b;
    }

    .tag .remove-tag {
        background: none;
        border: none;
        color: white;
        font-size: 0.9rem;
        margin-left: 6px;
        cursor: pointer;
        font-weight: bold;
        line-height: 0;
    }

        .tag .remove-tag:hover {
            color: red;
        }

/* ── RESULTS LIST & ITEMS ───────────────────────────────────── */
#results-list {
    list-style-type: none;
    padding: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background-color: white !important;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

    .result-item:hover {
        transform: translateY(-2px);
        background-color: #d5d5d5 !important;
    }

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    color: #0047ab;
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.package-version {
    font-size: 0.9rem;
    color: #666;
}

.result-summary {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 12px;
}

.result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: #555;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-actions {
    margin-top: 12px;
    text-align: right;
}

    .result-actions a {
        font-size: 0.85rem;
        background-color: #0047ab;
        color: white;
        padding: 6px 12px;
        border-radius: 6px;
        text-decoration: none;
        transition: background-color 0.3s ease, transform 0.2s ease;
    }

        .result-actions a:hover {
            background-color: #003b8b;
            transform: translateY(-2px);
        }

/* ── TAXONOMY TAGS ───────────────────────────────────────────── */
.ieee-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.taxonomy-tag {
    background-color: #ff9800;
    color: white;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

/* ── EXPAND BUTTON (FOR HIDDEN TAGS) ────────────────────────── */
.expand-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #0047ab;
    font-size: 1rem;
    transition: transform 0.2s ease;
    margin-left: 6px;
}

    .expand-btn:hover {
        transform: scale(1.1);
        color: #003b8b;
    }

/* ── TAG CONTAINER ───────────────────────────────────────────── */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    position: relative;
}

    .tag-container.expanded .hidden-tags {
        display: inline-flex;
        gap: 6px;
    }

    .tag-container.expanded .expand-btn {
        order: 1;
    }

/* ── FEATURE & QUALITY LABELS ─────────────────────────────────── */
.feature-label, .ieee-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #0047ab;
    margin-top: 8px;
    display: block;
}

/* ── FEATURE TAGS (QUALITY ATTRIBUTES) ──────────────────────────
        IMPORTANT: No explicit background-color is set so that inline styles (set via JS) take precedence */
.feature-tag {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s ease;
    background-color: #84afff; /* fallback: if no inline style, inherit */
    display:inline-flex;
}

    .feature-tag:hover {
        opacity: 0.7;        
    }

/* ── CVE TAGS ───────────────────────────────────────────────── */
.cve-tag {
    background-color: #fdf6e3;
    color: #657b83;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: default;
    margin-right: 4px;
}

/* ── BASKET CONTAINER ───────────────────────────────────────────── */
#basket-container {
    position: absolute;
    top: calc(100% + 5px);
    right: 10px;
    width: 280px;
    max-height: 400px;
    background: #fff;
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    z-index: 1000;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: none;
    font-size: 0.75rem; /* reduced overall font size */
}

    #basket-container h5 {
        background: #4282f9;
        color: #fff;
        margin: 0;
        padding: 6px 10px; /* reduced padding */
        text-align: center;
        border-radius: 6px 6px 0 0;
        font-size: 0.85rem; /* slightly smaller heading */
        letter-spacing: 0.3px;
    }

#basket-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    #basket-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 2px 4px; /* reduced padding */
        border-bottom: 1px solid #eee;
        transition: background-color 0.2s ease;
        width: 100%; /* force same width */
        box-sizing: border-box; /* include padding in width */
    }

        #basket-list li:hover {
            background-color: #f0f0f0; /* hover highlight */
        }

        #basket-list li:last-child {
            border-bottom: none;
        }

        #basket-list li button {
            background: #e74c3c;
            border: none;
            color: #fff;
            padding: 2px 2px; /* reduced padding */
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.2s ease;
            font-size: 0.7rem; /* reduced font size */
        }

            #basket-list li button:hover {
                background: #c0392b;
            }

#basket-toggle {
    display: inline-block;
    cursor: pointer;
    color: #0047ab;
    margin-right: 10px;
    font-size: 1.2rem; /* slightly reduced toggle font size */
}

/* Change background on hover */
#modal-basket-list li:hover {
    background-color: #f0f0f0; /* Light gray, adjust as needed */
    cursor: pointer;
}

/* Change background for a selected state */
#modal-basket-list li.selected {
    background-color: #d9edf7; /* A soft blue tone */
}

/* Highlight result items that are already in the basket */
.result-item.in-basket {
    background-color: #e0f7fa; /* Light blue background */
    border-left: 4px solid #00796b; /* Distinct left border */
}


/* ── RESPONSIVE ADJUSTMENTS ───────────────────────────────────── */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }
}
/* ── Splash screen text ───────────────────────────────────── */

/* Ensure multi-line text displays properly */
#searchTypingMessage {
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    color: #333;
    text-align: center;
}
/* Blinking cursor style */
#cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #333;
    margin-left: 2px;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}
/* ── Modal ───────────────────────────────────── */

#overviewModal .modal-dialog {
    max-width: 98%;
    margin: 10px auto;
}
/* ── Repositories (search results) ───────────────────────────────────── */

.result-item {
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: #fff;
    transition: background-color 0.3s;
}

    .result-item:hover {
        background-color: #f9f9f9;
    }

.result-header h5 {
    margin: 0;
}

.feature-tag {
    display: inline-block;
    background: #f0f0f0;
    border-radius: 3px;
    padding: 2px 6px;
    margin: 2px;
    font-size: 0.85em;
}

.expand-btn {
    cursor: pointer;
    color: #00796b;
    margin-left: 5px;
}

.hidden-tags {
    margin-top: 5px;
}
