/* GAGM Search Styles */

/* Search Input Container */
.gagm-search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.gagm-search-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    font-size: 16px;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s ease;
}

.gagm-search-input:focus {
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.1);
}

.gagm-search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #d35400;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background-color 0.3s ease;
}

.gagm-search-button:hover {
    background: #b8441f;
}

/* Search Suggestions */
.gagm-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.gagm-search-suggestions.visible {
    display: block;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-text mark {
    background-color: #fff3cd;
    padding: 0;
    font-weight: bold;
}

.suggestion-popular {
    font-size: 12px;
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
}

.suggestion-loading {
    padding: 12px 16px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Search Results */
.search-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.search-results-header {
    margin-bottom: 30px;
}

.search-results-header h2 {
    color: #333;
    margin-bottom: 8px;
}

.search-meta {
    color: #666;
    font-size: 14px;
}

/* Featured Results */
.featured-results {
    margin-bottom: 40px;
}

.featured-results h3 {
    color: #d35400;
    margin-bottom: 20px;
    font-size: 24px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.featured-result {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.featured-result img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.featured-content {
    padding: 16px;
}

.featured-result h4 {
    margin-bottom: 8px;
}

.featured-result h4 a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.featured-result h4 a:hover {
    color: #d35400;
}

.featured-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.featured-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #888;
}

.featured-meta .section {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Regular Search Results */
.search-results-list {
    margin-bottom: 40px;
}

.search-result {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

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

.search-result h4 {
    margin-bottom: 8px;
}

.search-result h4 a {
    color: #1a0dab;
    text-decoration: none;
    font-size: 18px;
}

.search-result h4 a:hover {
    text-decoration: underline;
}

.result-snippet {
    color: #545454;
    line-height: 1.5;
    margin-bottom: 8px;
}

.result-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.result-url {
    color: #006621;
}

.result-section {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
}

.result-score {
    margin-left: auto;
}

/* Pagination */
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
}

.pagination-btn {
    background: #d35400;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.pagination-btn:hover {
    background: #b8441f;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

/* Loading and Error States */
.search-loading,
.search-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.search-error {
    color: #dc3545;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
}

.no-results h2 {
    color: #333;
    margin-bottom: 16px;
}

.no-results p {
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .search-results-container {
        padding: 15px;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .result-score {
        margin-left: 0;
    }
    
    .search-pagination {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .gagm-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 10px 42px 10px 12px;
    }
    
    .gagm-search-button {
        width: 32px;
        height: 32px;
        right: 6px;
    }
    
    .featured-content {
        padding: 12px;
    }
    
    .search-result {
        padding: 15px 0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gagm-search-input {
        border-width: 3px;
    }
    
    .suggestion-item:hover,
    .suggestion-item.active {
        background-color: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gagm-search-input,
    .gagm-search-button,
    .suggestion-item,
    .featured-result {
        transition: none;
    }
}