/* AI Mode Container - Enhanced Palestinian-inspired design */
.ai-container {
    max-width: 100%;
    width: 100%;
    margin-bottom: 28px;
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

@keyframes keffiyehPattern {
    0% { background-position: 0 0; }
    100% { background-position: 24px 24px; }
}

@keyframes borderGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(27, 122, 43, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(27, 122, 43, 0.2); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes subtleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 0px rgba(27, 122, 43, 0); }
    50% { text-shadow: 0 0 8px rgba(27, 122, 43, 0.3); }
}

/* Enhanced AI Label with Palestinian-inspired design */
.ai-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-dark) 100%);
    background-size: 200% 200%;
    border-radius: 20px;
    margin-bottom: 24px;
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: white;
    box-shadow: 0 6px 20px rgba(27, 122, 43, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
    animation: borderGlow 3s ease-in-out infinite, gradientShift 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.ai-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(27, 122, 43, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: borderGlow 1.5s ease-in-out infinite, gradientShift 1.5s ease-in-out infinite;
}

.ai-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.ai-label::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 C8 4, 4 4, 0 0 M12 0 C16 4, 20 4, 24 0 M0 12 C4 8, 4 4, 0 0 M0 12 C4 16, 4 20, 0 24 M12 24 C8 20, 4 20, 0 24 M12 24 C16 20, 20 20, 24 24 M24 12 C20 8, 20 4, 24 0 M24 12 C20 16, 20 20, 24 24' fill='none' stroke='%23FFFFFF' stroke-width='0.3' opacity='0.1'/%3E%3C/svg%3E");
    background-size: 24px 24px;
    animation: keffiyehPattern 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.ai-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-icon {
    width: 22px;
    height: 22px;
    stroke: white;
    fill: none;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.ai-pulse {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
    pointer-events: none;
}

.ai-label-text {
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

body.rtl .ai-status {
    margin-right: 0;
    margin-left: auto;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.ai-status-dot.loading {
    background: #fbbf24;
    animation: pulse 1.2s infinite;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.ai-status-dot.streaming {
    background: #4ade80;
    animation: pulse 0.6s infinite;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.ai-status-dot.done {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.ai-status-dot.error {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

.ai-status-dot.idle {
    background: rgba(255, 255, 255, 0.8);
}

.ai-status-text {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
}

/* AI Response Card with Palestinian-inspired design */
.ai-response-card {
    background: var(--white);
    border-radius: 20px;
    padding: 0;
    border: 3px solid var(--border);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
    position: relative;
}

.ai-response-card:hover {
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.15);
    transform: translateY(-4px) translateX(-2px);
}

.ai-response-card::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 2px dashed var(--green-primary);
    opacity: 0.2;
    pointer-events: none;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.ai-response-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    border-bottom: 2px solid var(--gray-100);
    background: linear-gradient(to right, rgba(27, 122, 43, 0.05), transparent);
    position: relative;
    overflow: hidden;
}

.ai-response-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(27, 122, 43, 0.05));
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.ai-response-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(27, 122, 43, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.ai-response-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 C8 4, 4 4, 0 0 M12 0 C16 4, 20 4, 24 0 M0 12 C4 8, 4 4, 0 0 M0 12 C4 16, 4 20, 0 24 M12 24 C8 20, 4 20, 0 24 M12 24 C16 20, 20 20, 24 24 M24 12 C20 8, 20 4, 24 0 M24 12 C20 16, 20 20, 24 24' fill='none' stroke='%23FFFFFF' stroke-width='0.4' opacity='0.15'/%3E%3C/svg%3E");
    background-size: 24px 24px;
    animation: keffiyehPattern 20s linear infinite;
    pointer-events: none;
}

.ai-response-avatar svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    z-index: 1;
}

.ai-response-title h3 {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0 0 6px 0;
    position: relative;
    display: inline-block;
}

.ai-response-title h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--green-primary), var(--green-light));
    border-radius: 2px;
}

.ai-response-subtitle {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 15px;
    color: var(--gray-600);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* AI Response Content with enhanced styling */
.ai-response-content {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 17px;
    line-height: 1.9;
    color: var(--gray-800);
    direction: rtl;
    text-align: right;
    min-height: 120px;
    padding: 28px;
    background: linear-gradient(to bottom, var(--white), var(--off-white));
    position: relative;
}

.ai-response-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--green-primary), transparent);
    opacity: 0.1;
}

.ai-response-content h1 {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 1.8rem;
    color: var(--gray-900);
    margin: 1.75rem 0 1.25rem;
    font-weight: 800;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--green-primary);
    position: relative;
}

.ai-response-content h1::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--green-primary), var(--green-light));
}

.ai-response-content h2 {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 1.5rem;
    color: var(--gray-900);
    margin: 1.5rem 0 1rem;
    font-weight: 700;
    padding-left: 12px;
    border-left: 4px solid var(--green-primary);
}

.ai-response-content h3 {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 1.25rem;
    color: var(--gray-900);
    margin: 1.25rem 0 0.75rem;
    font-weight: 600;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--gray-100);
}

.ai-response-content strong {
    font-weight: 800;
    color: var(--gray-900);
    background: linear-gradient(120deg, rgba(27, 122, 43, 0.15) 0%, rgba(27, 122, 43, 0) 100%);
    padding: 0 4px;
    border-radius: 4px;
    position: relative;
}

.ai-response-content em {
    font-style: italic;
    color: var(--gray-700);
    background: linear-gradient(120deg, rgba(27, 122, 43, 0.05) 0%, rgba(27, 122, 43, 0) 100%);
    padding: 0 2px;
    border-radius: 2px;
}

.ai-response-content code {
    background: var(--gray-50);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--gray-800);
    border: 2px solid var(--gray-200);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-response-content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    direction: ltr;
    text-align: left;
    border: 2px solid var(--gray-800);
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.ai-response-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green-primary), var(--green-light));
}

.ai-response-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    border: none;
    font-size: 0.95em;
}

.ai-response-content a {
    color: var(--green-primary);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid rgba(27, 122, 43, 0.3);
    transition: all 0.2s ease;
    padding: 0 2px;
}

.ai-response-content a:hover {
    color: var(--green-dark);
    border-bottom-color: var(--green-primary);
    background: rgba(27, 122, 43, 0.1);
    border-radius: 2px;
}

.ai-response-content sup {
    font-size: 0.7em;
    vertical-align: super;
    line-height: 0;
    position: relative;
    top: -0.4em;
}

.ai-response-content sup a {
    color: var(--green-primary);
    font-weight: 800;
    text-decoration: none;
    padding: 2px 6px;
    background: rgba(27, 122, 43, 0.15);
    border-radius: 12px;
    transition: all 0.2s ease;
    border-bottom: none;
    margin: 0 1px;
}

.ai-response-content sup a:hover {
    background: rgba(27, 122, 43, 0.25);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(27, 122, 43, 0.2);
}

/* AI Placeholder */
.ai-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    text-align: center;
    padding: 30px;
    background: linear-gradient(to bottom, transparent, rgba(27, 122, 43, 0.02));
    border-radius: 12px;
}

.ai-placeholder-icon {
    margin-bottom: 16px;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

.ai-placeholder-icon svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
}

.ai-placeholder-text {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-600);
    margin: 0 0 8px 0;
}

.ai-placeholder-hint {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 14px;
    color: var(--gray-500);
    margin: 0;
    font-style: italic;
}

/* AI Loading */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 120px;
    padding: 30px;
    background: linear-gradient(to bottom, transparent, rgba(27, 122, 43, 0.02));
}

.ai-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-100);
    border-top-color: var(--green-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 4px 12px rgba(27, 122, 43, 0.15);
}

.ai-loading-text {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 15px;
    color: var(--gray-600);
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

/* AI Error */
.ai-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    text-align: center;
    padding: 30px;
    background: linear-gradient(to bottom, transparent, rgba(200, 16, 46, 0.02));
    border-radius: 12px;
}

.ai-error svg {
    width: 48px;
    height: 48px;
    stroke: var(--red-primary);
    margin-bottom: 16px;
    filter: drop-shadow(0 2px 4px rgba(200, 16, 46, 0.2));
}

.ai-error p {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 16px;
    color: var(--red-primary);
    margin: 0;
    font-weight: 600;
}

/* AI Response Footer */
.ai-response-footer {
    padding: 16px 28px;
    border-top: 2px solid var(--gray-100);
    background: var(--off-white);
    position: relative;
}

.ai-response-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--green-primary), transparent);
    opacity: 0.2;
}

.ai-response-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ai-response-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(to bottom, var(--white), var(--off-white));
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
    position: relative;
    overflow: hidden;
}

.ai-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(27, 122, 43, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
}

.ai-action-btn:hover {
    background: linear-gradient(to bottom, var(--off-white), var(--white));
    border-color: var(--green-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 122, 43, 0.15);
}

.ai-action-btn:hover::before {
    opacity: 1;
}

.ai-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-action-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.ai-action-btn:hover svg {
    transform: scale(1.1);
}

.ai-action-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
}

.ai-timestamp {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 13px;
    color: var(--gray-500);
    font-style: italic;
    background: rgba(27, 122, 43, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(27, 122, 43, 0.1);
}

/* Enhanced Sources Section */
.ai-sources-section {
    margin-top: 20px;
    background: var(--white);
    border-radius: 16px;
    padding: 0;
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.ai-sources-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    background: linear-gradient(to right, rgba(27, 122, 43, 0.03), transparent);
}

.ai-sources-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gray-50);
    flex-shrink: 0;
}

.ai-sources-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--gray-600);
}

.ai-sources-title {
    flex: 1;
}

.ai-sources-title h4 {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 2px 0;
}

.ai-sources-subtitle {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
    font-weight: 400;
}

.sources-count {
    background: var(--green-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Noto Kufi Arabic', sans-serif;
    min-width: 32px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(27, 122, 43, 0.2);
}

.ai-sources-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 24px;
    background: linear-gradient(to bottom, var(--off-white), var(--white));
}

.ai-source-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.ai-source-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--green-primary), var(--green-light));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ai-source-item:hover {
    background: var(--white);
    border-color: var(--green-primary);
    box-shadow: 0 4px 16px rgba(27, 122, 43, 0.1);
    transform: translateY(-2px);
}

.ai-source-item:hover::before {
    opacity: 1;
}

.ai-source-item .source-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-light) 100%);
    color: white;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Noto Kufi Arabic', sans-serif;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(27, 122, 43, 0.2);
}

.ai-source-item .source-info {
    flex: 1;
    min-width: 0;
}

.ai-source-item .source-title {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ai-source-item .source-url {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 13px;
    color: var(--gray-500);
    direction: ltr;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-sources-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--off-white);
}

.ai-sources-note {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
    text-align: center;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-container {
        margin-bottom: 24px;
    }
    
    .ai-label {
        padding: 8px 16px;
        font-size: 14px;
        margin-bottom: 16px;
        border-radius: 14px;
    }
    
    .ai-icon {
        width: 20px;
        height: 20px;
    }
    
    .ai-pulse {
        width: 28px;
        height: 28px;
    }
    
    .ai-status {
        padding: 3px 8px;
        border-radius: 10px;
    }
    
    .ai-status-text {
        font-size: 11px;
    }
    
    .ai-response-card {
        border-radius: 14px;
    }
    
    .ai-response-header {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .ai-response-avatar {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .ai-response-avatar svg {
        width: 20px;
        height: 20px;
    }
    
    .ai-response-title h3 {
        font-size: 16px;
    }
    
    .ai-response-subtitle {
        font-size: 13px;
    }
    
    .ai-response-content {
        font-size: 16px;
        line-height: 1.8;
        min-height: 100px;
        padding: 20px;
    }
    
    .ai-response-content h1 {
        font-size: 1.4rem;
    }
    
    .ai-response-content h2 {
        font-size: 1.2rem;
    }
    
    .ai-response-content h3 {
        font-size: 1.1rem;
    }
    
    .ai-placeholder {
        min-height: 100px;
        padding: 24px;
    }
    
    .ai-placeholder-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .ai-placeholder-text {
        font-size: 15px;
    }
    
    .ai-placeholder-hint {
        font-size: 13px;
    }
    
    .ai-loading {
        min-height: 100px;
        padding: 24px;
        gap: 16px;
    }
    
    .ai-spinner {
        width: 36px;
        height: 36px;
    }
    
    .ai-loading-text {
        font-size: 14px;
    }
    
    .ai-error {
        min-height: 100px;
        padding: 24px;
    }
    
    .ai-error svg {
        width: 40px;
        height: 40px;
    }
    
    .ai-error p {
        font-size: 15px;
    }
    
    .ai-response-footer {
        padding: 14px 20px;
    }
    
    .ai-action-btn {
        padding: 7px 14px;
        font-size: 13px;
    }
    
    .ai-action-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .ai-timestamp {
        font-size: 12px;
    }
    
    .ai-sources-section {
        margin-top: 16px;
        border-radius: 14px;
    }
    
    .ai-sources-header {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .ai-sources-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    
    .ai-sources-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .ai-sources-title h4 {
        font-size: 15px;
    }
    
    .ai-sources-subtitle {
        font-size: 12px;
    }
    
    .sources-count {
        padding: 3px 8px;
        font-size: 12px;
        min-width: 28px;
        border-radius: 10px;
    }
    
    .ai-sources-list {
        gap: 8px;
        padding: 16px 20px;
    }
    
    .ai-source-item {
        padding: 12px 14px;
        gap: 12px;
        border-radius: 10px;
    }
    
    .ai-source-item .source-number {
        min-width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .ai-source-item .source-title {
        font-size: 14px;
    }
    
    .ai-source-item .source-url {
        font-size: 12px;
    }
    
    .ai-sources-footer {
        padding: 14px 20px;
    }
    
    .ai-sources-note {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ai-container {
        margin-bottom: 20px;
    }
    
    .ai-label {
        padding: 6px 14px;
        font-size: 13px;
        margin-bottom: 14px;
        border-radius: 12px;
    }
    
    .ai-icon {
        width: 18px;
        height: 18px;
    }
    
    .ai-pulse {
        width: 24px;
        height: 24px;
    }
    
    .ai-status {
        padding: 2px 6px;
        border-radius: 8px;
    }
    
    .ai-status-dot {
        width: 6px;
        height: 6px;
    }
    
    .ai-status-text {
        font-size: 10px;
    }
    
    .ai-response-card {
        border-radius: 12px;
    }
    
    .ai-response-header {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .ai-response-avatar {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    
    .ai-response-avatar svg {
        width: 18px;
        height: 18px;
    }
    
    .ai-response-title h3 {
        font-size: 15px;
    }
    
    .ai-response-subtitle {
        font-size: 12px;
    }
    
    .ai-response-content {
        font-size: 15px;
        line-height: 1.75;
        min-height: 80px;
        padding: 16px;
    }
    
    .ai-response-content h1 {
        font-size: 1.3rem;
    }
    
    .ai-response-content h2 {
        font-size: 1.15rem;
    }
    
    .ai-response-content h3 {
        font-size: 1rem;
    }
    
    .ai-placeholder {
        min-height: 80px;
        padding: 20px;
    }
    
    .ai-placeholder-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .ai-placeholder-text {
        font-size: 14px;
    }
    
    .ai-placeholder-hint {
        font-size: 12px;
    }
    
    .ai-loading {
        min-height: 80px;
        padding: 20px;
        gap: 14px;
    }
    
    .ai-spinner {
        width: 32px;
        height: 32px;
    }
    
    .ai-loading-text {
        font-size: 13px;
    }
    
    .ai-error {
        min-height: 80px;
        padding: 20px;
    }
    
    .ai-error svg {
        width: 36px;
        height: 36px;
    }
    
    .ai-error p {
        font-size: 14px;
    }
    
    .ai-response-footer {
        padding: 12px 16px;
    }
    
    .ai-action-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .ai-action-btn svg {
        width: 12px;
        height: 12px;
    }
    
    .ai-timestamp {
        font-size: 11px;
    }
    
    .ai-sources-section {
        margin-top: 14px;
        border-radius: 12px;
    }
    
    .ai-sources-header {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .ai-sources-icon {
        width: 32px;
        height: 32px;
        border-radius: 6px;
    }
    
    .ai-sources-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .ai-sources-title h4 {
        font-size: 14px;
    }
    
    .ai-sources-subtitle {
        font-size: 11px;
    }
    
    .sources-count {
        padding: 2px 6px;
        font-size: 11px;
        min-width: 24px;
        border-radius: 8px;
    }
    
    .ai-sources-list {
        gap: 6px;
        padding: 14px 16px;
    }
    
    .ai-source-item {
        padding: 10px 12px;
        gap: 10px;
        border-radius: 8px;
    }
    
    .ai-source-item .source-number {
        min-width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    .ai-source-item .source-title {
        font-size: 13px;
    }
    
    .ai-source-item .source-url {
        font-size: 11px;
    }
    
    .ai-sources-footer {
        padding: 12px 16px;
    }
    
    .ai-sources-note {
        font-size: 11px;
    }
}
