/* ===================================
   SEARCH BAR STYLES
   =================================== */

.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 25px;
    padding: 0.3rem 0.8rem;
    transition: all 0.3s ease;
    overflow: hidden;
    width: fit-content;
    max-width: 180px;
    height: 42px;
    box-sizing: border-box;
}

.search-container:focus-within {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffd700;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem;
    width: 100%;
    min-width: 80px;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-input::placeholder {
    color: rgba(255, 215, 0, 0.5);
    font-weight: 400;
}

.btn-search {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
    padding: 0.2rem 0.3rem;
    line-height: 1;
    flex-shrink: 0;
}

.btn-search:hover {
    transform: scale(1.1);
}

.search-icon {
    display: block;
}

/* 📱 Tablet Search Bar - Medium Size */
@media (min-width: 481px) and (max-width: 768px) {
    .search-container {
        padding: 6px 12px;
        max-width: 150px;
        height: 38px;
    }
    
    .search-input {
        font-size: 0.85rem;
    }
    
    .btn-search {
        font-size: 1rem;
    }
}

/* 📱 Mobile Search Bar - Proportional to Menu Button */
@media (max-width: 480px) {
    .search-container {
        padding: 5px 10px !important;
        gap: 4px !important;
        border-radius: 18px !important;
        border-width: 1.5px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        max-width: 90px !important;
        overflow: hidden !important;
        height: 28px !important;
        box-sizing: border-box !important;
        margin-left: 8px !important;
    }
    
    .search-input {
        font-size: 0.65rem !important;
        padding: 0 !important;
        min-width: 48px !important;
        max-width: 52px !important;
        letter-spacing: 0.3px !important;
        flex-shrink: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    .btn-search {
        font-size: 0.85rem !important;
        padding: 2px 4px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
}

/* ===================================
   SEARCH RESULTS MODAL
   =================================== */

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.search-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(255, 215, 0, 0.2);
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.search-modal-header h2 {
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    margin: 0;
}

.btn-close-search {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-search:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: rotate(90deg);
}

.search-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

#searchResultsContainer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateX(5px);
}

.search-result-text {
    color: #ffffff;
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.search-result-author {
    color: #ffd700;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.search-result-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: rgba(255, 215, 0, 0.6);
}

.search-result-meta span {
    background: rgba(255, 215, 0, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

#searchLoadingIndicator {
    text-align: center;
    padding: 3rem;
    color: #ffd700;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#searchPagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.btn-pagination {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-pagination:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-pagination:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#searchPageInfo {
    color: #ffd700;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .search-input {
        min-width: 120px;
        font-size: 0.85rem;
    }
    
    .search-modal {
        padding: 1rem;
    }
    
    .search-modal-content {
        max-height: 90vh;
    }
    
    .search-result-text {
        font-size: 1rem;
    }
    
    #searchPagination {
        flex-direction: column;
        gap: 0.8rem;
    }
}
