/* ===========================================
   AI SEARCH ENGINE v2 - MODERN STYLES
   =========================================== */

/* Βασικά στυλ */
.ai-search-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Φόρμα αναζήτησης */
.search-form-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    position: relative;
}

#ai-search-input {
    flex: 1;
    padding: 18px 25px;
    font-size: 18px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    color: #333;
    font-weight: 500;
}

#ai-search-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
    background: #fff;
}

#ai-search-button {
    padding: 18px 35px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}

#ai-search-button:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

#get-ai-answer {
    padding: 18px 30px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

#get-ai-answer:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* Αποτελέσματα αναζήτησης - ΜΟΝΟ ΤΙΤΛΟΙ */
#search-results {
    margin-top: 20px;
}

.results-count {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

/* ΚΑΡΤΕΛΑ ΑΠΟΤΕΛΕΣΜΑΤΩΝ - ΝΕΟ ΣΤΥΛ */
.search-result {
    padding: 25px;
    margin-bottom: 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Γκρίζο φόντο και περγραμμή */
.search-result {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Hover effect - Κόκκινο φόντο με αχνό transparency */
.search-result:hover {
    background: rgba(220, 38, 38, 0.05); /* Αχνό κόκκινο */
    border-color: #dc2626;
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.15);
}

/* Τίτλος άρθρου */
.result-header {
    margin-bottom: 0;
}

.result-header h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.4;
}

.result-header h3 a {
    color: #1f2937;
    text-decoration: none;
    font-weight: 600;
    display: block;
    transition: color 0.3s ease;
}

/* Χρώμα τίτλου στο hover */
.search-result:hover .result-header h3 a {
    color: #dc2626;
}

/* Meta πληροφορίες */
.result-meta {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    font-size: 14px;
    color: #6b7280;
}

.result-type, .result-date, .result-categories {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.result-type::before {
    content: "📄";
}

.result-date::before {
    content: "📅";
}

.result-categories::before {
    content: "🏷️";
}

/* Highlight λέξεων αναζήτησης */
.search-highlight {
    background-color: rgba(220, 38, 38, 0.15);
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 50px;
    color: #dc2626;
    font-size: 18px;
    font-weight: 500;
}

.loading:before {
    content: "⏳";
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AI Απάντηση */
#ai-answer {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #bae6fd;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

#ai-answer:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #dc2626, #2563eb);
}

.ai-answer-content h3 {
    margin-top: 0;
    color: #1e40af;
    font-size: 24px;
    margin-bottom: 20px;
}

.answer-text {
    line-height: 1.8;
    font-size: 17px;
    color: #374151;
}

.answer-text p {
    margin-bottom: 15px;
}

/* Pagination */
.search-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.page-button {
    padding: 12px 20px;
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #4b5563;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.page-button:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    transform: translateY(-2px);
}

.page-current {
    padding: 12px 20px;
    background: #dc2626;
    color: white;
    border-radius: 8px;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
    border: 2px solid #dc2626;
}

/* Dark mode toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

#dark-mode-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f2937, #111827);
    color: white;
    border: 3px solid #374151;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#dark-mode-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .ai-search-container {
        margin: 20px;
        padding: 25px;
    }
    
    .search-form-wrapper {
        flex-direction: column;
    }
    
    #ai-search-input,
    #ai-search-button,
    #get-ai-answer {
        width: 100%;
        text-align: center;
    }
    
    .search-result {
        padding: 20px;
    }
    
    .result-header h3 {
        font-size: 19px;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-pagination {
        flex-wrap: wrap;
    }
}

/* Animation για εμφάνιση αποτελεσμάτων */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result {
    animation: fadeInUp 0.5s ease-out;
}

/* Subtle pattern στο φόντο της κάρτας */
.search-result:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 95%, rgba(220, 38, 38, 0.03) 95%),
        linear-gradient(-45deg, transparent 95%, rgba(220, 38, 38, 0.03) 95%);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.3;
    z-index: 0;
    border-radius: 10px;
}

.result-header,
.result-meta {
    position: relative;
    z-index: 1;
}
/* ===========================================
   ADDITIONAL STYLES FOR ENHANCED JS
   =========================================== */

/* Typing indicator */
.typing-indicator {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.typing-indicator .dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.typing-indicator .dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator .dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator .dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Results header */
.results-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.search-method {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-top: 5px;
}

/* Result actions */
.result-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-result:hover .result-actions {
    opacity: 1;
}

.view-button, .copy-link {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.view-button {
    background: #3b82f6;
    color: white;
    text-decoration: none;
}

.copy-link {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.view-button:hover {
    background: #2563eb;
}

.copy-link:hover {
    background: #e5e7eb;
}

/* No results styling */
.no-results {
    text-align: center;
    padding: 40px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.search-suggestions, .ai-help-section {
    text-align: left;
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
}

.quick-search-buttons {
    margin: 25px 0;
}

.quick-search-buttons button {
    margin: 5px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-search-buttons button:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.ai-help-button {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ai-help-button:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
}

/* Error results */
.error-results {
    text-align: center;
    padding: 40px;
    background: #fef2f2;
    border-radius: 12px;
    border: 2px solid #fca5a5;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-actions {
    margin: 25px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.retry-button, .simplify-button {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.retry-button {
    background: #10b981;
    color: white;
}

.simplify-button {
    background: #f59e0b;
    color: white;
}

.error-debug {
    margin-top: 25px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
}

/* Page info */
.page-info {
    text-align: center;
    margin-top: 15px;
    color: #6b7280;
    font-size: 14px;
}

.results-info {
    color: #9ca3af;
}

.page-dots {
    padding: 8px 5px;
}

/* AI Loading */
.ai-loading {
    text-align: center;
    padding: 30px;
}

.ai-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: ai-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AI Answer */
.ai-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.ai-icon {
    font-size: 32px;
}

.ai-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 14px;
}

/* Alerts */
.ai-alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #7f1d1d;
}

.alert-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #78350f;
}

.alert-info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* Initial instruction */
.initial-instruction {
    text-align: center;
    padding: 40px;
}

.instruction-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.example-searches {
    margin: 30px 0;
}

.example-searches ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.example-search {
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-search:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.features ul {
    list-style: none;
    padding: 0;
    max-width: 500px;
    margin: 20px auto;
    text-align: left;
}

.features li {
    padding: 8px 0;
    position: relative;
    padding-left: 30px;
}

.features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Debug info */
.debug-info {
    margin-top: 20px;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    color: #6b7280;
}

/* Dark mode adjustments */
body.dark-mode-active .no-results {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode-active .search-suggestions,
body.dark-mode-active .ai-help-section {
    background: #4b5563;
}

body.dark-mode-active .quick-search-buttons button {
    background: #4b5563;
    border-color: #6b7280;
    color: #e5e7eb;
}

body.dark-mode-active .error-results {
    background: #451a1a;
    border-color: #7f1d1d;
}

body.dark-mode-active .error-debug {
    background: #374151;
}

body.dark-mode-active .features li:before {
    color: #34d399;
}