:root {
  color-scheme: light only;
}

/* Override any dark mode media queries */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light only;
  }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* BG */

.background-layer {
    background: linear-gradient(-45deg, #5552ee, #0396FF, #4d18c9);
    background-size: 400% 500%;
    animation: gradient 15s ease infinite;
    height: 100vh;
    overflow: hidden;
    position: fixed; /* Changed from relative to fixed */
    top: 0;
    left: 0;
    width: 100%;
    z-index: -1; /* Make sure it stays behind content */
    margin: 0;
    padding: 0;
}

/* Update the pseudo-elements to target .background-layer instead */
.background-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.05) 20px,
            rgba(255, 255, 255, 0.05) 22px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.03) 20px,
            rgba(255, 255, 255, 0.03) 22px
        ),
        radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px, 40px 40px, 30px 30px;
    animation: patternMove 20s linear infinite;
}

.background-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 30%),
        radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 25%);
    animation: orbFloat 25s ease-in-out infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes patternMove {
    0% {
        background-position: 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 40px 40px, -40px -40px, 30px 30px;
    }
}

@keyframes orbFloat {
    0%, 100% {
        background-position: 20% 30%, 80% 70%, 60% 20%, 30% 80%;
    }
    25% {
        background-position: 30% 40%, 70% 60%, 50% 30%, 40% 70%;
    }
    50% {
        background-position: 40% 20%, 60% 80%, 70% 10%, 20% 90%;
    }
    75% {
        background-position: 10% 50%, 90% 50%, 80% 40%, 10% 60%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.3;
    }
}

/* BG */


.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
	z-index: 999;
}

.search-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 100%;
    max-width: 900px;
    padding: 40px;
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 2.5em;
    color: #ffffff;
    margin-bottom: 10px;
    font-weight: 400;
}

.subtitle {
    color: #ffffff;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.info-box {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.info-box p {
    color: #ffffff;
    margin: 8px 0;
    font-size: 0.95em;
    line-height: 1.4;
    text-align: left;
}

.info-box p:first-child {
    text-align: center;
    font-size: 1em;
    margin-bottom: 15px;
}

.search-form {
    margin-bottom: 30px;
}

.search-input-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 20px 25px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.send-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(-45deg, #5552ee, #0396FF, #4d18c9);
	background-size: 400% 400%;
	animation: gradient 15s ease infinite;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    opacity: 0.7;
}

.send-icon:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    background: #5a67d8;
}

.send-icon:active {
    transform: translateY(-50%) scale(0.95);
}

/* Styles pour le conteneur CAPTCHA */
.captcha-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.captcha-container label {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.captcha-container span {
    color: #ffffff !important;
    font-weight: bold;
    font-size: 16px;
}

.captcha-container input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.captcha-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 1);
}

.search-input {
    width: 100%;
    padding: 20px 65px 20px 25px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 15px 25px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f8f9fa;
    border-left: 3px solid #667eea;
}

.suggestion-item.selected {
    background-color: #e8f0fe;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    text-align: left;
}

.suggestion-category-badge {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    line-height: 1.3;
    background-color: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

.suggestion-excerpt {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 4px;
    text-align: left;
}

.quick-search-item {
    transition: all 0.2s ease;
}

.quick-search-item:hover .suggestion-title {
    color: #667eea;
}

.match-indicator {
    font-size: 14px;
    margin-left: 8px;
    opacity: 0.8;
}

.match-indicator.high-match {
    animation: pulse 2s infinite;
}

.match-indicator.medium-match {
    opacity: 0.6;
}

@keyframes pulse {
    0% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.8;
    }
}

.suggestion-category {
    padding: 10px 25px;
    background-color: #667eea;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-category.ai-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.suggestion-category.ai-category::after {
    content: '🤖';
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
}

.suggestions-loading {
    padding: 15px 25px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.suggestions-loading::before {
    content: '⏳';
    margin-right: 8px;
}



.loading {
    display: none;
    margin: 20px 0;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-container {
    display: none;
    text-align: left;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.source-badge {
    position: absolute;
    top: 0;
    right: 0;
    padding: 8px 15px;
    border-radius: 0 15px 0 15px;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
}

.source-badge.database {
    background-color: #27ae60;
}

.source-badge.ai {
    background-color: #9b59b6;
}

.result-title {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 20px;
    font-weight: 600;
}

.result-content {
    line-height: 1.6;
    color: #333;
    margin-top: 20px;
}

.result-content h1, .result-content h2, .result-content h3 {
    margin: 15px 0 10px 0;
    color: #667eea;
}

.result-content h1 {
    font-size: 1.4em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.result-content h2 {
    font-size: 1.2em;
}

.result-content h3 {
    font-size: 1.1em;
}

.result-content ul, .result-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.result-content li {
    margin: 5px 0;
}

.result-content strong {
    color: #333;
    font-weight: 600;
}

.result-content code {
    background: #e9ecef;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.result-content blockquote {
    border-left: 4px solid #667eea;
    background: #ffffff;
    margin: 10px 0;
    padding: 10px 15px;
    font-style: italic;
    color: #666;
}

.feedback-section {
    text-align: center;
    margin-top: 20px;
}

.feedback-text {
    color: #555;
    font-size: 1em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.new-search-button, .assistance-button {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    font-weight: 500;
}

.new-search-button:hover, .assistance-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.assistance-button {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.assistance-button:hover {
    background: #219a52;
    border-color: #219a52;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

@media (max-width: 600px) {
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .new-search-button, .assistance-button {
        width: 100%;
        max-width: 280px;
    }
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .search-container {
        padding: 20px;
    }
    
    .logo {
        font-size: 2em;
    }
    
    .search-input {
        padding: 15px 20px;
    }
    
    .search-button {
        padding: 15px 30px;
    }
}

.suggestions-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.suggestions-section h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.suggestions-section ul {
    list-style: none;
    padding: 0;
}

.suggestions-section li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.suggestions-section li:last-child {
    border-bottom: none;
}

.suggestions-section li strong {
    color: #667eea;
}

.suggestions-section li em {
    color: #6c757d;
}

.suggestion-link {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.suggestion-link:hover {
    background-color: #e9ecef;
    cursor: pointer;
}

.suggestion-link strong {
    color: #667eea;
}

.suggestion-link:hover strong {
    color: #5a6fd8;
}


/* Confirmation Dialog Styles - Inspired by Chat Widget */
.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirmation-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirmation-dialog {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.confirmation-overlay.show .confirmation-dialog {
    transform: scale(1) translateY(0);
}

.confirmation-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    text-align: center;
}

.confirmation-message {
    font-size: 14px;
    color: #fff;
    line-height: 1.5;
    margin-bottom: 24px;
    text-align: center;
}

.confirmation-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirmation-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.confirmation-button.primary {
    background: #0056b3bd;
    color: white;
}

.confirmation-button.primary:hover {
    background: #0470e4;
    transform: translateY(-1px);
}

.confirmation-button.secondary {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.confirmation-button.secondary:hover {
    background: rgb(255, 255, 255);
    color: #000;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .confirmation-dialog {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .confirmation-buttons {
        flex-direction: column;
    }
}