/* Search page specific styles */

/* Background Watermark */
.background-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 200px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.05);
    z-index: -1;
    pointer-events: none;
    user-select: none;
}

/* Main Content for search page */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: calc(100vh - 120px);
}

.search-section {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Search Title */
.search-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 0;
}

/* Examples Title */
.examples-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 12px;
    margin-top: 0;
}

/* Advanced Search Link */
.advanced-search-link {
    width: 100%;
    max-width: 700px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.advanced-search-link a {
    color: #000000;
    text-decoration: underline;
    font-size: 16px;
    font-weight: 700;
    transition: color 0.2s ease;
}

.advanced-search-link a:hover {
    color: #666666;
}

/* Search Container */
.search-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.search-bar-container {
    width: 100%;
    max-width: 700px;
}

.search-input-group {
    display: flex;
    border: 1px solid #000000;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
    position: relative;
    align-items: flex-end;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    padding-right: 60px;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    background-color: transparent;
    resize: none;
    min-height: 60px;
    line-height: 1.5;
}

.search-input::placeholder {
    color: #cccccc !important;
}

.search-input::-webkit-input-placeholder {
    color: #cccccc !important;
}

.search-input::-moz-placeholder {
    color: #cccccc !important;
}

.search-input:-ms-input-placeholder {
    color: #cccccc !important;
}

.search-button {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 8px;
    border: none;
    background-color: #f5f5f5;
    color: #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    width: 36px;
    height: 36px;
}

.search-button:hover {
    background-color: #e8e8e8;
}

.search-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Suggested Questions */
.suggested-questions {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.question-item {
    background-color: #f5f5f5;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    color: #000000;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
}

.question-item:hover {
    background-color: #e8e8e8;
}

/* Advanced Search Modes */
.advanced-search-modes {
    width: 100%;
    max-width: 700px;
    margin-top: 20px;
}

.advanced-search-content {
    width: 100%;
}

.advanced-search-modes .card {
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.advanced-search-modes .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.keyword-field {
    transition: all 0.2s ease;
}

.keyword-field:hover {
    transform: translateY(-1px);
}

.keyword-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.remove-keyword {
    transition: all 0.2s ease;
}

.remove-keyword:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

#add-keyword {
    transition: all 0.2s ease;
}

#add-keyword:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Results Section */
.results-container {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
}

.results-count-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.results-info-icon {
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
}


.results-info-popup {
    position: absolute;
    background: white;
    border: 2px solid #8B5CF6;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 200px;
    max-width: 250px;
    display: block;
    font-style: normal;
    font-weight: normal;
    color: #333;
    top: -10px;
    left: 100%;
    margin-left: 10px;
}

.results-info-popup::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #8B5CF6;
}

.results-info-popup::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 21px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 7px solid #fff;
}

.authors-unknown-popup {
    position: absolute;
    background: white;
    border: 2px solid #8B5CF6;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 200px;
    max-width: 250px;
    display: none;
    font-style: normal;
    font-weight: normal;
    top: -10px;
    left: 0;
    margin-left: 0;
}

.authors-unknown-popup::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #8B5CF6;
}

.authors-unknown-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 21px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #fff;
}

.publication-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    transition: box-shadow 0.2s ease;
}

.publication-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.publication-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    position: relative;
}

.publication-title-section {
    flex: 1;
    margin-right: 20px;
    max-width: calc(100% - 120px); /* Reserve space for the score section */
}

.publication-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
    line-height: 1.4;
    flex: 1;
    margin-right: 20px;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.publication-authors {
    font-size: 0.9rem;
    color: #666;
    margin-top: 4px;
    margin-bottom: 16px;
    font-weight: normal;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.authors-unknown {
    cursor: pointer;
    position: relative;
}

.authors-unknown i {
    color: #000;
    margin-left: 4px;
    transition: opacity 0.2s ease;
}

.authors-unknown:hover i {
    opacity: 0.7;
}

.publication-score-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.curation-status-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.curation-status-indicator {
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
    min-width: 60px;
}

.curation-info-icon {
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.curation-info-icon:hover {
    opacity: 0.7;
}

.curation-status-indicator.accepted {
    background-color: #28a745;
}

.curation-status-indicator.disclaimer {
    background-color: #ffc107;
}

.curation-status-indicator.rejected {
    background-color: #dc3545;
}

.curation-status-indicator.error {
    background-color: #dc3545;
}

.vector-score {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    min-width: 50px;
    text-align: center;
}

.external-link-icon {
    color: #6c757d;
    font-size: 2.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
    z-index: 10;
}

.external-link-icon:hover {
    color: #007bff;
}

.publication-metadata {
    font-size: 0.9rem;
    color: #666;
    position: relative;
    line-height: 1.6;
    margin-top: 12px;
}

.publication-abstract {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
    text-align: justify;
}

.doi-link {
    color: #007bff;
    text-decoration: none;
}

.doi-link:hover {
    text-decoration: underline;
}

/* Add this CSS for the divider */
.publication-divider {
    margin: 12px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
    opacity: 0.6;
}

/* Add this CSS for the search-results divider */
.search-results-divider {
    margin: 24px 0 16px 0;
    border: none;
    border-top: 2px solid #e0e0e0;
    opacity: 0.8;
}

/* Popup/Tooltip Styling */
.rating-popup {
    position: absolute;
    background: #fff;
    border: 2px solid #8B5CF6;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 280px;
    max-width: 320px;
    display: none;
}

.rating-popup::before {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #8B5CF6;
}

.rating-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 21px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #fff;
}

.rating-section {
    border-bottom: 2px solid #8B5CF6;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.rating-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.rating-title {
    font-weight: 700;
    font-size: 1rem;
    color: #000;
    margin-bottom: 8px;
}

.rating-content {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

.score-highlight {
    font-weight: 700;
    color: #000;
}

/* Bootstrap tooltip customization for fallback */
.tooltip-inner {
    max-width: 300px;
    text-align: left;
    padding: 8px 12px;
    font-size: 0.875rem;
    background-color: #fff;
    color: #000;
    border: 1px solid #8B5CF6;
}

.tooltip.bs-tooltip-auto[x-placement^=top] .arrow::before,
.tooltip.bs-tooltip-top .arrow::before {
    border-top-color: #8B5CF6;
}

.tooltip.bs-tooltip-auto[x-placement^=bottom] .arrow::before,
.tooltip.bs-tooltip-bottom .arrow::before {
    border-bottom-color: #8B5CF6;
}

/* Footer styles are now in base template */

/* Loading spinner */
.spin {
    animation: spin 1s linear infinite;
}

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

/* Loading Message Styles */
.loading-message {
    width: 100%;
    max-width: 700px;
    margin-top: 30px;
    padding: 40px 20px;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.loading-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* Responsive adjustments for loading message */
@media (max-width: 768px) {
    .loading-message {
        margin-top: 20px;
        padding: 30px 15px;
    }
    
    .loading-content {
        gap: 16px;
    }
    
    .spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
    
    .loading-title {
        font-size: 1rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .loading-message {
        padding: 25px 12px;
    }
    
    .loading-content {
        gap: 14px;
    }
    
    .spinner {
        width: 28px;
        height: 28px;
        border-width: 2px;
    }
    
    .loading-title {
        font-size: 0.95rem;
    }
    
    .loading-subtitle {
        font-size: 0.85rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: row;
        gap: 0;
    }
    
    .navigation {
        gap: 20px;
    }
    
    /* Ensure dropdown aligns with the same right padding */
    .navigation.is-open {
        right: 20px;
    }
    
    .background-watermark {
        font-size: 120px;
    }
    
    .search-section {
        padding: 0 20px;
    }
    
    .footer {
        padding: 20px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    
    .footer-logos {
        justify-content: center;
        gap: 30px;
    }
    
    .footer-support {
        text-align: center;
        flex-direction: column;
        gap: 12px;
    }
    
    .movetia-subtitles {
        align-items: center;
    }
    
    /* Mobile-specific publication card adjustments */
    .publication-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .publication-title {
        margin-right: 0;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .publication-score-section {
        align-self: flex-end;
        flex-direction: row;
        gap: 12px;
        min-width: auto;
    }
    
    .curation-status-container {
        flex-direction: row;
        gap: 4px;
    }
    
    .publication-title-section {
        flex: 1;
        margin-right: 16px;
    }
    
    .publication-metadata {
        margin-top: 12px;
    }
    
    .rating-popup {
        min-width: 250px;
        max-width: 280px;
    }
    
    .rating-popup::before,
    .rating-popup::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .navigation.is-open {
        justify-content: flex-start;
    }
    
    .nav-link {
        font-size: 14px;
    }
    
    .background-watermark {
        font-size: 80px;
    }
    
    .search-input {
        font-size: 14px;
    }
    
    .question-item {
        font-size: 14px;
    }
    
    /* Extra small screen adjustments */
    .publication-card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .publication-title {
        font-size: 1.1rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .publication-score-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .rating-popup {
        min-width: 220px;
        max-width: 250px;
        padding: 12px;
    }
    
    .rating-title {
        font-size: 0.9rem;
    }
    
    .rating-content {
        font-size: 0.8rem;
    }
}