/* Chat Page Styles */
:root {
    --primary-color: #4896d2;
    --primary-dark: #3a7bb8;
    --secondary-color: #212c5f;
    --accent-color: #212c5f;
    --success-color: #2ecc71;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #4896d2 0%, #212c5f 50%, #212c5f 100%);
    --gradient-secondary: linear-gradient(135deg, #212c5f 0%, #4896d2 50%, #212c5f 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-secondary);
    height: 100vh;
    overflow: hidden;
    direction: rtl;
}

/* Header */
.chat-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    backdrop-filter: blur(10px);
}

.header-text h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.language-switcher,
.clear-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.language-switcher:hover,
.clear-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lang-text {
    font-size: 0.75rem;
    font-weight: 700;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-top: 70px;
    position: relative;
}

/* Response Badge */
.response-badge {
    position: absolute;
    top: 90px;
    right: 50%;
    transform: translateX(50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    animation: fadeInDown 0.5s ease-out;
}

.response-badge i {
    color: var(--primary-color);
}

.badge-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(50%) translateY(0);
    }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(248, 249, 250, 0.3));
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-message h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.welcome-message p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.quick-action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.quick-action-btn span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-action-btn:hover {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn:hover i,
.quick-action-btn:hover span {
    color: white;
}

/* Message Styles */
.message {
    max-width: 70%;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    word-wrap: break-word;
    animation: messageSlide 0.4s ease-out;
    position: relative;
    box-shadow: var(--shadow-sm);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    background: var(--gradient-primary);
    color: white;
    align-self: flex-end;
    margin-right: 0;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.message.bot {
    background: white;
    color: var(--text-primary);
    align-self: flex-start;
    margin-left: 0;
    margin-right: auto;
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border-color);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    display: block;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    align-self: flex-start;
    max-width: 90px;
    box-shadow: var(--shadow-sm);
}

.typing-dot {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typingBounce 1.6s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-12px) scale(1.2);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    background: white;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.attach-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.attach-button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

#message-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    direction: rtl;
    text-align: right;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

#message-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(72, 150, 210, 0.1);
}

.send-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.send-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-lg);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.input-footer {
    text-align: center;
    margin-top: 0.75rem;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* LTR Support */
[dir="ltr"] .message.user {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 20px;
    margin-left: auto;
    margin-right: 0;
}

[dir="ltr"] .message.bot {
    border-bottom-right-radius: 6px;
    border-bottom-left-radius: 20px;
    margin-right: auto;
    margin-left: 0;
}

[dir="ltr"] #message-input {
    direction: ltr;
    text-align: left;
}

[dir="ltr"] .chat-messages {
    direction: ltr;
}

[dir="ltr"] .welcome-message {
    direction: ltr;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-header {
        padding: 0.75rem 1rem;
        height: 60px;
    }

    .header-content {
        padding: 0;
    }

    .header-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .header-text h3 {
        font-size: 1rem;
    }

    .status-indicator {
        font-size: 0.75rem;
    }

    .back-button,
    .language-switcher,
    .clear-button {
        width: 36px;
        height: 36px;
    }

    .chat-container {
        padding-top: 60px;
    }

    .response-badge {
        top: 75px;
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .chat-messages {
        padding: 1.5rem 1rem;
        gap: 1rem;
    }

    .welcome-message {
        padding: 2rem 1.5rem;
    }

    .welcome-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .welcome-message h2 {
        font-size: 1.5rem;
    }

    .welcome-message p {
        font-size: 1rem;
    }

    .quick-actions {
        gap: 0.75rem;
    }

    .quick-action-btn {
        padding: 0.75rem 1rem;
        min-width: 80px;
    }

    .quick-action-btn i {
        font-size: 1.25rem;
    }

    .quick-action-btn span {
        font-size: 0.75rem;
    }

    .message {
        max-width: 85%;
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    .chat-input-container {
        padding: 1rem;
    }

    .input-wrapper {
        gap: 0.75rem;
    }

    .attach-button,
    .send-button {
        width: 40px;
        height: 40px;
    }

    #message-input {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 0.5rem;
    }

    .header-info {
        gap: 0.75rem;
    }

    .header-text h3 {
        font-size: 0.9375rem;
    }

    .status-text {
        display: none;
    }

    .response-badge {
        display: none;
    }

    .welcome-message {
        padding: 1.5rem 1rem;
    }

    .quick-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-action-btn {
        width: 100%;
        flex-direction: row;
        justify-content: center;
    }

    .message {
        max-width: 90%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

