/* Neo-brutalism Search Styles with Love */

/* Search container */
#search-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
    background-color: #fff;
    background-image:
        radial-gradient(#FFD1DC 6px, transparent 6px),
        radial-gradient(#FFD1DC 6px, transparent 6px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    border: 3px solid #000;
    border-radius: 0;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.7);
    position: absolute;
    z-index: 99999;
    width: 450px; /* Smaller width */
    right: 0;
    display: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(0);
}

.dark #search-content {
    background-color: var(--background-color-dark);
    background-image:
        radial-gradient(rgba(255, 209, 220, 0.2) 6px, transparent 6px),
        radial-gradient(rgba(255, 209, 220, 0.2) 6px, transparent 6px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 8px 8px 0 rgba(255, 255, 255, 0.15);
}

/* Search header */
#search-content::before {
    content: "✨ Results ✨";
    display: block;
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #000;
    background-color: #FFD1DC;
    border: 3px solid #000;
    padding: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.7);
    position: relative;
}

.dark #search-content::before {
    color: #000;
    background-color: rgba(255, 209, 220, 0.8);
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.15);
}

/* Add cute hearts to the header */
#search-content::after {
    content: "♥";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
    color: #FF6B8B;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Search result cards */
#search-results .card {
    border: 3px solid #000;
    border-radius: 0;
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: #fff;
    background-image: linear-gradient(45deg, #f6f6f6 25%, transparent 25%, transparent 75%, #f6f6f6 75%, #f6f6f6),
                      linear-gradient(45deg, #f6f6f6 25%, transparent 25%, transparent 75%, #f6f6f6 75%, #f6f6f6);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    overflow: hidden;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.7);
    position: relative;
    width: 100%;
    cursor: pointer;
}

.dark #search-results .card {
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 5px 5px 0 rgba(255, 255, 255, 0.15);
    background-color: var(--background-color-dark);
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%, rgba(255, 255, 255, 0.05)),
                      linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%, rgba(255, 255, 255, 0.05));
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    cursor: pointer;
}

#search-results .card:hover {
    transform: translateY(-3px);
    box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.7);
}

.dark #search-results .card:hover {
    box-shadow: 7px 7px 0 rgba(255, 255, 255, 0.15);
}

/* Add heart decorations to cards */
#search-results .card::before {
    content: "♥";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
    color: #FF6B8B;
    z-index: 1;
}

/* Card content */
#search-results .card a {
    display: block;
    padding: 0 !important;
    color: #000 !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.01em;
    position: relative;
}

.dark #search-results .card a {
    color: var(--text-color) !important;
}

#search-results .card .p-3 {
    padding: 15px !important;
}

#search-results .card h5 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000 !important;
    transition: all 0.2s ease;
    display: inline-block;
    font-weight: bold;
}

.dark #search-results .card h5 {
    color: var(--text-color) !important;
}

#search-results .card .result-description {
    font-size: 0.9rem;
    color: #000 !important;
    line-height: 1.5;
    margin-top: 10px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border: 2px solid #000;
}

.dark #search-results .card .result-description {
    color: var(--text-color) !important;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

/* Section path styling */
#search-results .card .section-path {
    font-size: 0.8rem;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

.dark #search-results .card .section-path {
    color: #aaa;
}

/* Section labels */
.section-label {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 10px;
    background-color: #FFD1DC;
    color: #000 !important;
    border: 2px solid #000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    float: right;
    margin-top: 5px;
    font-weight: bold;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
    position: relative;
}

.section-label::before {
    content: "♥";
    display: inline-block;
    margin-right: 3px;
    font-size: 10px;
    vertical-align: middle;
}

.dark .section-label {
    border: 2px solid rgba(255, 255, 255, 0.7);
    background-color: rgba(255, 209, 220, 0.8);
    color: #000 !important;
    box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.15);
}

/* Different section types with cute colors */
.blog-result {
    border-left: 10px solid #FF6B8B !important;
}

.blog-result .section-label {
    background-color: #FF6B8B;
}

.page-result {
    border-left: 10px solid #A2D2FF !important;
}

.page-result .section-label {
    background-color: #A2D2FF;
}

.project-result {
    border-left: 10px solid #FDFD96 !important;
}

.project-result .section-label {
    background-color: #FDFD96;
}

/* No results message */
#search-results .no-results {
    text-align: center;
    padding: 25px;
    font-size: 1.1rem;
    color: #000;
    border: 3px solid #000;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.7);
    background-color: #FFD1DC;
    margin-top: 20px;
    position: relative;
}

#search-results .no-results::before {
    content: "♥";
    display: block;
    font-size: 30px;
    color: #FF6B8B;
    margin-bottom: 10px;
}

#search-results .no-results::after {
    content: "Try another search term";
    display: block;
    font-size: 0.9rem;
    margin-top: 10px;
    font-style: italic;
}

.dark #search-results .no-results {
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 8px 8px 0 rgba(255, 255, 255, 0.15);
    color: #000;
    background-color: rgba(255, 209, 220, 0.8);
}

/* Custom scrollbar */
#search-content::-webkit-scrollbar {
    width: 8px;
}

#search-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0;
}

#search-content::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 0;
}

.dark #search-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.7);
}

#search-content::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.dark #search-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Responsive styles */
@media (max-width: 992px) {
    #search-content {
        width: 90vw;
        max-width: 450px;
        right: 5vw;
        left: 5vw;
        padding: 15px;
        position: fixed !important;
        /* top is now set dynamically in JavaScript */
        z-index: 9999 !important;
        margin-top: 5px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    }

    #search-content::before {
        font-size: 1.1rem;
        margin-bottom: 10px;
        padding: 8px;
    }

    #search-results {
        width: 100% !important;
    }

    /* Ensure the navbar stays open when search is active */
    .navbar-collapse.show {
        display: block !important;
    }
}

@media (max-width: 768px) {
    #search-content {
        width: 90vw;
        max-width: 350px;
    }

    #search-results .card {
        margin-bottom: 12px;
    }

    #search-results .card h5 {
        font-size: 1rem;
    }

    .section-label {
        padding: 3px 8px;
        font-size: 0.65rem;
    }

    #search-results .card .result-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        padding: 8px;
        margin-top: 8px;
        margin-bottom: 8px;
    }

    #search-results .card .p-3 {
        padding: 10px !important;
    }
}
