/* =================================
  Revamped CSS for Search Results
  =================================
*/

/* Main container for the search results dropdown */
#results {
    position: relative; 
    z-index: 1000;      
    display: flex;
    justify-content: center; /* Horizontally center the child .result-box */
}

/* NEW: Styling for the search box itself */
#searchBox {
    border: 1px solid #ced4da;
    border-radius: 25px; /* Pill shape */
    padding: 10px 20px;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#searchBox:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.15);
}


.result-box {
    /* Centering and Sizing */
    position: absolute; /* Changed for better positioning */
    width: 90%;
    max-width: 700px; /* Adjust max-width as needed */
    text-align: center; /* Center all text inside the box */

    /* Appearance & Colors */
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 16px; /* Softer corners */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
    
    /* Layout and Overflow */
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
    
    /* Smooth fade-in animation */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    display: none; /* Initially hidden */
}

/* This class is added by JavaScript to show the results */
.result-box.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Styling for category headers (e.g., "Jobs", "Results") */
.result-category {
    font-size: 1.1rem;
    font-weight: 700;
    color: #004085; /* Dark blue for headers */
    margin: 16px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #ffca2c; /* Gold accent line */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Adding icons to the category headers */
.result-category::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1rem;
    display: inline-block;
}

/* Specific icons for each category */
.result-category:is(:contains("Jobs"))::before { content: "\f0b1"; } /* Briefcase icon */
.result-category:is(:contains("Admit Cards"))::before { content: "\f145"; } /* Ticket icon */
.result-category:is(:contains("Results"))::before { content: "\f0a3"; } /* Certificate icon */
.result-category:is(:contains("Answer Keys"))::before { content: "\f023"; } /* Key icon */
.result-category:is(:contains("OTR"))::before { content: "\f2c2"; } /* ID card icon */
.result-category:is(:contains("Syllabus"))::before { content: "\f02d"; } /* Book icon */


/* Styling for the list of results */
.result-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Individual list item */
.result-box li {
    margin: 4px 0;
}

/* UPDATED: Link inside each list item */
.result-box a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #495057; /* Dark grey text for readability */
    font-weight: 500;
    border-radius: 10px;
    background-color: #f8f9fa; /* Light background for each link */
    border: 1px solid #e9ecef; /* Subtle border */
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* UPDATED: Hover effect for the links */
.result-box a:hover {
    background-color: #0056b3; /* Main blue color on hover */
    color: #ffffff; /* White text on hover */
    transform: scale(1.02); /* Slightly enlarge on hover */
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.2);
}

/* Custom scrollbar for a cleaner look */
.result-box::-webkit-scrollbar {
    width: 10px;
}

.result-box::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

.result-box::-webkit-scrollbar-thumb {
    background-color: #ced4da;
    border-radius: 10px;
    border: 2px solid #f8f9fa;
}

.result-box::-webkit-scrollbar-thumb:hover {
    background-color: #adb5bd;
}
