/**
 * File: search-results.css
 * Version: 1.0.0
 * Location: /frontend/static/css/modules/search-results.css
 * Purpose: Styling for search results with no wrapping
 * Modified: 2024-12-24
 */


/* Search result styles */
.search-info {
    padding: 10px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 0.9em;
    color: #2c3e50;
}

.book-result {
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.book-result-header {
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.book-result-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.book-result-header.expanded {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-bottom: 1px solid #90caf9;
}

.book-expand-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
    color: #495057;
    width: 20px;
    text-align: center;
}

.book-expand-icon.expanded {
    transform: rotate(90deg);
}

.book-result-title {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.book-match-count {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.book-matches-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafbfc;
}

.book-matches-container.expanded {
    max-height: 400px;
    overflow-y: auto;
}

.search-match-item {
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 32px;
    white-space: nowrap;
    overflow: hidden;
}

.search-match-item:hover {
    background: linear-gradient(to right, #f0f8ff, #e6f3ff);
}

.search-match-item:last-child {
    border-bottom: none;
}

.match-page-num {
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    min-width: 45px;
    text-align: center;
}

.match-line-text {
    flex: 1;
    font-size: 0.85em;
    color: #495057;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-line-text mark {
    background: linear-gradient(135deg, #fff9c4 0%, #ffeb3b 100%);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: #f57c00;
}

.load-more-container {
    padding: 10px;
    text-align: center;
    background: #f8f9fa;
}

.primary-match {
    background-color: #ffeb3b;
    font-weight: bold;
}

.secondary-match {
    background-color: #fff59d;
    opacity: 0.7;
}

.load-more-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hide template elements */
.template-container {
    display: none !important;
}

/* Highlight target for scrolling */
/* Regular search highlights */
.search-highlight {
    background-color: #ffeb3b;
    padding: 2px 0;
}

/* Target/clicked search highlight */
.search-highlight-target {
    background-color: #ff9632;
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
    animation: pulse 1s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes highlight-pulse {
    0% { background-color: #ffeb3b; }
    100% { background-color: transparent; }
}
/* Default highlight color for all search occurrences */
.search-occurrence {
    background-color: #ffeb3b; /* Light yellow */
    padding: 2px 4px;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

/* Active/current search result - different color */
.search-occurrence.current-search-result {
    background-color: #ff9800; /* Orange */
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
    outline: 2px solid #ff5722;
    outline-offset: 1px;
}

/* Alternative: Use different colors for visual distinction */
.search-occurrence.active-occurrence {
    background-color: #4caf50; /* Green */
    color: white;
}

/* Hover effect for all occurrences */
.search-occurrence:hover {
    background-color: #ffc107; /* Amber on hover */
    cursor: pointer;
}

/* Ensure text remains readable */
.search-occurrence.current-search-result {
    color: #000; /* Black text on orange background */
}

/* For Arabic text pages */
.page-content.arabic-text {
    direction: rtl;
    text-align: justify;
    line-height: 1.8;
    font-family: 'Amiri', 'Scheherazade', 'Arial', sans-serif;
}

/* Preserve formatting in text display */
.formatted-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Page container */
.page-container {
    padding: 20px;
    max-width: 100%;
    width: 100%;
}
/*EndFile*/