/* Search Page Specific Styles */

/* Layout Overrides for Search Page */
.main-wrapper {
    overflow: hidden; /* Ensure footer visibility */
}

.search-page-content {
    flex: 1;
    height: 100%;
    overflow: hidden; /* Prevent page scroll */
    display: flex;
    flex-direction: column;
    padding-top: 3rem; /* Reduced top padding */
    justify-content: flex-start;
}

.search-hero-title {
    margin-bottom: 2rem;
    font-size: clamp(1.8rem, 5vw, 3rem);
    opacity: 1;
    flex-shrink: 0;
}

.search-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
    flex: 1; /* Take remaining space */
    overflow: hidden; /* Contain children */
}

.search-box-wrapper {
    width: 100%;
    position: relative;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--gold-dark);
    color: #fff;
    font-size: 1.5rem;
    padding: 1.2rem 3.5rem 1.2rem 1.5rem;
    font-family: 'Noto Serif SC', serif;
    transition: all 0.3s ease;
    border-radius: 4px; /* Slight rounded corners */
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.3);
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--gold-light);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-dark);
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    color: var(--gold-primary);
}

/* Results Area */
.search-results {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1; /* Adaptive height */
    overflow-y: auto; /* Internal scroll */
    padding-right: 0.5rem; /* Space for scrollbar */
    padding-bottom: 1rem;
    max-height: none; /* Remove fixed height constraint */
}

/* Custom Scrollbar */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

.result-card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(197, 160, 89, 0.2);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
    flex-shrink: 0; /* Prevent card compression */
}

.result-card:hover {
    border-color: var(--gold-primary);
    border-left-color: var(--gold-dark);
    background: rgba(30, 30, 30, 0.9);
    transform: translateX(5px);
}

.result-title {
    color: var(--gold-primary);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.result-excerpt {
    color: #aaa;
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.tag {
    background: rgba(197, 160, 89, 0.1);
    color: var(--gold-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    letter-spacing: 0.05em;
}

.no-results {
    text-align: center;
    color: #666;
    margin-top: 2rem;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

/* Modal Styles for Article (replicating style.css logic) */
#articleModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.4s;
}

#articleModal.active {
    display: flex;
    opacity: 1;
}

#articleModal .modal-content {
    background: #000;
    border: 1px solid var(--gold-primary);
    padding: 3rem;
    width: 85%;
    max-width: 800px; /* Wider for reading */
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

#articleModal .info-text {
    color: #ccc;
    font-size: 1rem;
    line-height: 2;
    letter-spacing: 0.05em;
    text-align: justify;
}

/* Mobile Adaptation */
@media (max-width: 768px) {
    .search-input {
        font-size: 1.1rem;
        padding: 1rem 3rem 1rem 1rem;
    }
    
    .search-page-content {
        padding-top: 2rem;
    }
    
    .result-card {
        padding: 1.2rem;
    }

    #articleModal .modal-content {
        padding: 3rem 2rem; /* Match style.css .modal-content */
        width: 85%; /* Match style.css .modal-content */
        max-width: 320px; /* Match style.css .modal-content */
    }
}
