/**
 * XMLA Support AI - Glassmorphic Styling
 * Brand Colors:
 * - Deep Navy: #0B1320
 * - XMLA Blue: #2B78B8
 * - Highlight Blue: #3B8ED0
 * - Light Background: #F6F8FC
 */

/* Base Container - Dark Theme */
.xmla-support-ai-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.xmla-dark-theme {
    background-color: #0B1320;
    color: rgba(255, 255, 255, 0.92);
}

.xmla-light-theme {
    background-color: #F6F8FC;
    color: #0B1320;
}

/* Glassmorphic Card - Dark Theme */
.xmla-dark-theme .xmla-glass-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Glassmorphic Card - Light Theme */
.xmla-light-theme .xmla-glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(11, 19, 32, 0.08);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
}

/* Header Section */
.xmla-header {
    text-align: center;
    margin-bottom: 32px;
}

.xmla-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #3B8ED0;
    letter-spacing: -0.5px;
}

.xmla-subtitle {
    font-size: 16px;
    margin: 0;
    opacity: 0.82;
    font-weight: 400;
}

.xmla-dark-theme .xmla-subtitle {
    color: rgba(255, 255, 255, 0.82);
}

.xmla-light-theme .xmla-subtitle {
    color: rgba(11, 19, 32, 0.7);
}

/* Form Container */
.xmla-form-container {
    margin-bottom: 24px;
}

.xmla-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.xmla-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.xmla-label {
    font-size: 14px;
    font-weight: 600;
    color: #3B8ED0;
    letter-spacing: 0.3px;
}

/* Textarea Styling */
.xmla-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.xmla-dark-theme .xmla-textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
}

.xmla-dark-theme .xmla-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.xmla-dark-theme .xmla-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.10);
    border-color: #3B8ED0;
    box-shadow: 0 0 0 3px rgba(59, 142, 208, 0.15);
}

.xmla-light-theme .xmla-textarea {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(11, 19, 32, 0.15);
    color: #0B1320;
}

.xmla-light-theme .xmla-textarea::placeholder {
    color: rgba(11, 19, 32, 0.4);
}

.xmla-light-theme .xmla-textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: #2B78B8;
    box-shadow: 0 0 0 3px rgba(43, 120, 184, 0.12);
}

/* Submit Button with Gradient */
.xmla-submit-btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(180deg, #3B8ED0 0%, #2B78B8 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(43, 120, 184, 0.3);
    position: relative;
    overflow: hidden;
}

.xmla-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 120, 184, 0.4);
}

.xmla-submit-btn:active {
    transform: translateY(0);
}

.xmla-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.xmla-btn-text,
.xmla-btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Spinner Animation */
.xmla-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: xmla-spin 0.8s linear infinite;
}

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

/* Result Container */
.xmla-result-container {
    margin-top: 32px;
    animation: xmla-fade-in 0.4s ease-out;
}

@keyframes xmla-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.xmla-result-header {
    margin-bottom: 16px;
}

.xmla-result-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #3B8ED0;
}

/* Answer Display */
.xmla-answer {
    padding: 20px;
    border-radius: 10px;
    line-height: 1.7;
    font-size: 15px;
}

.xmla-dark-theme .xmla-answer {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
}

.xmla-light-theme .xmla-answer {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(11, 19, 32, 0.1);
    color: #0B1320;
}

/* Format AI response content */
.xmla-answer p {
    margin: 0 0 12px 0;
}

.xmla-answer p:last-child {
    margin-bottom: 0;
}

.xmla-answer ul,
.xmla-answer ol {
    margin: 12px 0;
    padding-left: 24px;
}

.xmla-answer li {
    margin-bottom: 8px;
}

.xmla-answer strong {
    color: #3B8ED0;
    font-weight: 600;
}

.xmla-answer code {
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.xmla-dark-theme .xmla-answer code {
    background: rgba(59, 142, 208, 0.15);
    color: #3B8ED0;
}

.xmla-light-theme .xmla-answer code {
    background: rgba(43, 120, 184, 0.1);
    color: #2B78B8;
}

/* Support Footer */
.xmla-support-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid;
}

.xmla-dark-theme .xmla-support-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.xmla-light-theme .xmla-support-footer {
    border-top-color: rgba(11, 19, 32, 0.1);
}

.xmla-support-text {
    font-size: 14px;
    margin: 0;
    opacity: 0.82;
    line-height: 1.6;
}

.xmla-link {
    color: #3B8ED0;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.xmla-link:hover {
    color: #2B78B8;
    text-decoration: underline;
}

/* Error Container */
.xmla-error-container {
    margin-top: 24px;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: xmla-fade-in 0.4s ease-out;
}

.xmla-dark-theme .xmla-error-container {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.xmla-light-theme .xmla-error-container {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.xmla-error-icon {
    font-size: 24px;
}

.xmla-error-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.xmla-dark-theme .xmla-error-message {
    color: rgba(255, 255, 255, 0.92);
}

.xmla-light-theme .xmla-error-message {
    color: #0B1320;
}

/* Responsive Design */
@media (max-width: 768px) {
    .xmla-support-ai-container {
        padding: 16px;
    }

    .xmla-glass-card {
        padding: 24px !important;
    }

    .xmla-title {
        font-size: 24px;
    }

    .xmla-subtitle {
        font-size: 14px;
    }

    .xmla-textarea {
        font-size: 14px;
    }

    .xmla-submit-btn {
        font-size: 15px;
        padding: 12px 24px;
    }
}

@media (max-width: 480px) {
    .xmla-glass-card {
        padding: 20px !important;
    }

    .xmla-title {
        font-size: 22px;
    }

    .xmla-answer {
        font-size: 14px;
    }
}
