/**
 * AI Search Dialog Styles
 */

/* Floating Action Button */
.elac-ai-search-fab {
    position: fixed !important;
    bottom: 30px !important;
    left: 30px !important;
    right: auto !important;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(26, 35, 126, 0.4);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ffffff;
}

.elac-ai-search-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(26, 35, 126, 0.5);
}

.elac-ai-search-fab:active {
    transform: scale(0.95);
}

.elac-ai-search-fab svg {
    width: 28px;
    height: 28px;
}

/* Dialog/Modal */
.elac-ai-search-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.elac-ai-search-dialog.elac-ai-search-dialog-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Backdrop */
.elac-ai-search-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Dialog Content */
.elac-ai-search-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.elac-ai-search-dialog.elac-ai-search-dialog-open .elac-ai-search-content {
    transform: scale(1) translateY(0);
}

/* Dialog Header */
.elac-ai-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: #ffffff;
}

.elac-ai-search-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.elac-ai-search-header h2 svg {
    width: 24px;
    height: 24px;
}

.elac-ai-search-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.elac-ai-search-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.elac-ai-search-close svg {
    width: 20px;
    height: 20px;
}

/* Dialog Body */
.elac-ai-search-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.elac-ai-search-hint {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 0.95rem;
}

/* Search Form */
.elac-ai-search-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.elac-ai-search-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.elac-ai-search-input-wrapper input:focus {
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.elac-ai-search-submit {
    padding: 12px 20px;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.elac-ai-search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

.elac-ai-search-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading Indicator */
.elac-ai-search-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: #f5f7fa;
    border-radius: 10px;
}

.elac-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a237e;
    border-radius: 50%;
    animation: elac-spin 1s linear infinite;
}

@keyframes elac-spin {
    to { transform: rotate(360deg); }
}

/* Results */
.elac-ai-search-results {
    margin-top: 20px;
}

.elac-ai-search-answer {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    line-height: 1.7;
}

.elac-ai-search-answer p {
    margin: 0 0 12px 0;
}

.elac-ai-search-answer p:last-child {
    margin-bottom: 0;
}

.elac-ai-search-answer strong {
    color: #1a237e;
    font-weight: 600;
}

.elac-ai-search-answer ul {
    margin: 12px 0;
    padding-left: 24px;
}

.elac-ai-search-answer li {
    margin: 8px 0;
}

/* Sources */
.elac-ai-search-sources {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.elac-ai-search-sources h4 {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.elac-ai-search-sources ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.elac-ai-search-sources li {
    margin: 8px 0;
}

.elac-ai-search-sources a {
    color: #1a237e;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.elac-ai-search-sources a:hover {
    text-decoration: underline;
}

.elac-ai-search-sources a::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #1a237e;
    border-radius: 50%;
}

/* Error State */
.elac-ai-search-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #ffebee;
    border-radius: 10px;
    color: #c62828;
}

.elac-ai-search-error svg {
    flex-shrink: 0;
}

/* Footer */
.elac-ai-search-footer {
    padding: 12px 24px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.elac-ai-search-footer small {
    color: #999;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 576px) {
    .elac-ai-search-fab {
        bottom: 20px !important;
        left: 20px !important;
        right: auto !important;
        width: 50px !important;
        height: 50px !important;
    }

    .elac-ai-search-fab svg {
        width: 24px;
        height: 24px;
    }

    .elac-ai-search-content {
        width: 95%;
        max-height: 90vh;
    }

    .elac-ai-search-header {
        padding: 16px;
    }

    .elac-ai-search-header h2 {
        font-size: 1.1rem;
    }

    .elac-ai-search-body {
        padding: 16px;
    }

    .elac-ai-search-input-wrapper {
        flex-direction: column;
    }
}
