/* ==================== ABP Chat Assistant Theme - رعايه جو ==================== */
/* Based on ABP Framework UI Packages - Modern Chat Interface */

/* ==================== Chat Shell ==================== */
.assist-shell {
    min-height: 100vh;
    padding: var(--spacing-lg) var(--spacing-md);
    background: var(--bg-gradient);
    position: relative;
    overflow: hidden;
}

/* تم إزالة تأثير الجزيئات المتطايرة */

/* ==================== Container ==================== */
.container-narrow {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 1;
}

/* ==================== Page Header ==================== */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.page-head h2 {
    margin: 0;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--text-inverse);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* ==================== ABP Chat Card ==================== */
.assist-shell .glass-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.assist-shell .glass-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

[data-theme="dark"] .assist-shell .glass-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

/* ==================== Info Banner - ABP Alert Style ==================== */
.info-banner {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--primary);
    font-weight: 500;
}

[data-theme="dark"] .info-banner {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    color: var(--primary-light);
}

.info-banner i {
    font-size: 1.75rem;
    color: var(--primary);
}

/* ==================== Chat Container - Premium Design ==================== */
#chat {
    max-height: 58vh;
    min-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    scroll-behavior: smooth;
}

[data-theme="dark"] #chat {
    background: rgba(15, 23, 42, 0.3);
    border-color: var(--border-color);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Premium Scrollbar */
#chat::-webkit-scrollbar {
    width: 12px;
}

#chat::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 10px;
    margin: var(--spacing-md) 0;
}

#chat::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

#chat::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    background-clip: padding-box;
}

/* ==================== Messages - ABP Chat Style ==================== */
.msg {
    display: flex;
    margin-bottom: var(--spacing-lg);
    animation: messageSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg.user {
    justify-content: flex-end;
}

.msg.bot {
    justify-content: flex-start;
}

/* ==================== Chat Bubbles - Modern Design ==================== */
.bubble {
    max-width: 70%;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    line-height: 1.7;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    position: relative;
}

.bubble:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* User Bubble - Main Theme Gradient */
.msg.user .bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

/* Bot Bubble - Clean Card */
.msg.bot .bubble {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .msg.bot .bubble {
    background: rgba(51, 65, 85, 0.8);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* ==================== Typing Indicator ==================== */
.typing-indicator {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    justify-content: center;
}

.typing-indicator span {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    animation: typingBounce 1.4s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
    }
    30% {
        transform: translateY(-15px) scale(1.2);
    }
}

/* ==================== Chat Form - ABP Input Style ==================== */
#chatForm {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

#msg {
    flex-grow: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

#msg::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

#msg:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
    background: var(--bg-primary);
}

[data-theme="dark"] #msg {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] #msg:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

/* ==================== Send Button - Main Theme ==================== */
#sendBtn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: var(--spacing-md) var(--spacing-xl);
    font-weight: 700;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.875rem;
    min-width: 140px;
}

#sendBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#sendBtn:active:not(:disabled) {
    transform: translateY(0);
}

#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==================== Status Messages - ABP Style ==================== */
#status {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-fast);
}

#status:not(:empty) {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: var(--primary);
}

#status.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

[data-theme="dark"] #status.error {
    color: var(--danger);
}

#status.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

[data-theme="dark"] #status.success {
    color: var(--success);
}

/* ==================== Spinner ==================== */
.spinner-border-sm {
    width: 1.125rem;
    height: 1.125rem;
    border-width: 0.2em;
}

/* ==================== Text Utilities ==================== */
.text-muted {
    color: #8898aa !important;
}

[data-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

.form-text {
    color: #8898aa;
    font-size: 0.875rem;
}

[data-theme="dark"] .form-text {
    color: #adb5bd;
}

/* ==================== Empty State ==================== */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
}

.chat-empty i {
    font-size: 5rem;
    color: rgba(94, 114, 228, 0.3);
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.chat-empty h3 {
    color: #32325d;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .chat-empty h3 {
    color: #e9ecef;
}

.chat-empty p {
    color: #8898aa;
}

[data-theme="dark"] .chat-empty p {
    color: #adb5bd;
}

/* ==================== Suggestion Buttons ==================== */
.suggestions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.suggestion-btn {
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    background: white;
    border: 2px solid rgba(94, 114, 228, 0.2);
    color: var(--chat-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

[data-theme="dark"] .suggestion-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e9ecef;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 992px) {
    .assist-shell {
        padding: 1.5rem 0.75rem;
    }
    
    .glass-card {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }
    
    #chat {
        min-height: 400px;
        max-height: 55vh;
    }
}

@media (max-width: 768px) {
    .assist-shell {
        padding: 1rem 0.5rem;
    }
    
    .container-narrow {
        padding: 0 0.5rem;
    }
    
    .glass-card {
        padding: 1.25rem;
    }
    
    #chat {
        max-height: 50vh;
        min-height: 350px;
        padding: 1rem;
    }
    
    .bubble {
        max-width: 85%;
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }
    
    #chatForm {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    #sendBtn {
        width: 100%;
        padding: 1rem 2rem;
    }
    
    #msg {
        width: 100%;
        padding: 1rem 1.5rem;
    }
    
    .page-head h2 {
        font-size: 1.75rem;
    }
    
    .info-banner {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .bubble {
        max-width: 92%;
        padding: 0.875rem 1rem;
    }
    
    #chat {
        max-height: 45vh;
        min-height: 300px;
        padding: 0.75rem;
    }
    
    .glass-card {
        padding: 1rem;
        border-radius: 1.25rem;
    }
    
    .page-head {
        margin-bottom: 1.5rem;
    }
}

/* ==================== Avatar Badges ==================== */
.avatar-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.5rem;
}

.avatar-badge.user {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
    color: white;
}

.avatar-badge.bot {
    background: linear-gradient(135deg, var(--chat-success) 0%, #20bf6b 100%);
    color: white;
}

/* ==================== Loading State ==================== */
.chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.chat-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    color: var(--chat-primary);
}

