/* Subject List Styling */
.subject-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0;
    margin: 2rem 0;
    list-style: none;
}

/* Individual Subject Cards */
.subject-list li {
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    animation: fadeIn 0.5s ease forwards;
}



/* Subject Text Styling */
.short-form {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.full-name {
    font-size: 1.0rem;
    color: var(--text-secondary);
}

/* Hover Effects */
.subject-list a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

/* Bottom Border Hover Animation */
.subject-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--accent-primary);
    transition: width 0.3s ease-out, left 0.3s ease-out;
}

.subject-list a:hover::after {
    width: 100%;
    left: 0;
}

/* Fade-In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    background: var(--secondary-bg);
    border-radius: var(--border-radius-soft);
    margin: 2rem auto;
    max-width: 500px;
    display: none;
    border: 1px solid var(--border-color);
}

.no-results-message.visible {
    display: block;
}

/* Search Highlight Styling */
mark {
    background-color: rgba(45, 118, 204, 0.15);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 2px;
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    background: var(--secondary-bg);
    border: 1.5px solid var(--accent-primary);
    border-radius: var(--border-radius-soft);
    box-shadow: none;
    z-index: 1000;
    max-height: 60vh;
    overflow-y: auto;
    display: none;
    padding: 8px 0;
    min-width: 320px;
}

.search-result-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.18s, transform 0.18s;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    min-width: 0;
}

.search-result-row:last-child {
    border-bottom: none;
}

.search-result-row:hover {
    background: rgba(45, 118, 204, 0.13);
    transform: translateX(3px) scale(1.01);
}

.result-type-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 16px;
    padding: 3px 12px;
    min-width: 120px;
    justify-content: flex-start;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.qp-row .result-type-label {
    background: rgba(45, 118, 204, 0.18);
    color: #2d76cc;
    border: 1px solid #2d76cc;
}

.code-row .result-type-label {
    background: rgba(40, 167, 70, 0.13);
    color: #28a746;
    border: 1px solid #28a746;
}

.result-emoji {
    font-size: 1.1em;
    margin-right: 2px;
}

.result-type-text {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.result-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
    width: 100%;
}

.result-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
    margin-right: 4px;
}

.result-branch {
    font-size: 0.98rem;
    color: var(--text-secondary);
    font-weight: 400;
    white-space: normal;
    word-break: break-word;
    margin-left: 0;
}

.search-no-results {
    padding: 18px 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    font-style: italic;
}

/* Highlight for matched text */
.search-result-row mark {
    background-color: rgba(45, 118, 204, 0.18);
    color: var(--text-primary);
    border-radius: 2px;
    padding: 0 2px;
}

.result-shortcode {
    color: var(--text-secondary);
    font-size: 0.93em;
    margin-left: 4px;
    font-weight: 500;
    opacity: 0.85;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem 3%;
    }

    .search-dropdown {
        position: fixed !important;
        top: var(--header-height);
        left: 0 !important;
        width: 100vw !important;
        min-width: 0;
        max-width: 100vw;
        border-radius: 0 0 12px 12px;
        z-index: 2000;
        box-shadow: none;
        padding: 0;
    }
    .search-result-row {
        padding: 10px 8px;
        font-size: 0.98rem;
        min-height: 36px;
        gap: 8px;
    }
    .result-type-label {
        min-width: 70px;
        font-size: 0.92rem;
        padding: 3px 7px;
    }
    .result-main {
        flex-wrap: wrap;
        gap: 4px;
    }
    .result-name {
        font-size: 1rem;
        margin-right: 2px;
    }
    .result-branch {
        font-size: 0.93rem;
    }
    .search-no-results {
        padding: 12px 4px;
        font-size: 0.95rem;
    }
}

/* Focus State for Accessibility */
.subject-list a:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-primary);
}

:root {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --accent-primary: #2d76cc; /* Blue theme color */
    --accent-secondary: #1d5bb1;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-highlight: #2d76cc; /* Highlight color for matched text */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius-soft: 12px;
    --transition-speed: 0.3s;
}