/**
 * ایجنت نظام وظیفه - UI ایرانی و کاربرپسند
 */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --secondary: #3b82f6;
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 16px;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    direction: rtl;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100vh;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Mobile responsive */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        max-width: 1000px;
        height: 90vh;
        max-height: 850px;
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
    }
}

/* ========== Header ========== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 20px;
    border-bottom: 3px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 400;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .header {
        padding: 20px 30px;
    }
    
    .logo-icon {
        font-size: 48px;
    }
    
    .logo-text h1 {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .logo-text p {
        font-size: 13px;
    }
    
    .status-indicator {
        gap: 8px;
        padding: 8px 16px;
        font-size: 14px;
    }
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== Chat Container ========== */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-main);
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    .chat-messages {
        padding: 30px;
    }
}

/* ========== Welcome Card ========== */
.welcome-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: wave 1s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

.welcome-card h2 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.welcome-card p {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .welcome-card {
        padding: 40px;
    }
    
    .welcome-icon {
        font-size: 64px;
        margin-bottom: 20px;
    }
    
    .welcome-card h2 {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .welcome-card p {
        font-size: 15px;
        margin-bottom: 30px;
    }
}

.quick-questions {
    margin-top: 30px;
}

.quick-title {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 15px;
    font-weight: 500;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 10px;
    background: var(--bg-main);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-dark);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: right;
}

.quick-btn:hover {
    background: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quick-icon {
    font-size: 20px;
}

/* ========== Messages ========== */
.message {
    margin-bottom: 24px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.8;
    font-size: 15px;
}

.user-message .message-content {
    background: var(--primary);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 6px;
}

.bot-message .message-content {
    background: white;
    color: var(--text-dark);
    box-shadow: var(--shadow);
    border-bottom-right-radius: 6px;
}

.bot-message .message-content p {
    margin-bottom: 12px;
}

.bot-message .message-content p:last-child {
    margin-bottom: 0;
}

.bot-message .message-content strong {
    color: var(--primary);
    font-weight: 600;
}

/* ========== Loading ========== */
.loading {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    max-width: fit-content;
}

.loading.active {
    display: flex;
}

.typing-indicator {
    display: flex;
    gap: 6px;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.loading p {
    color: var(--text-gray);
    font-size: 14px;
}

/* ========== Input Form ========== */
.input-form {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 2px solid var(--border);
    border-radius: 24px;
    padding: 8px 12px;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    background: white;
}

#queryInput {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.6;
    padding: 8px 0;
    display: flex;
    align-items: center;
}

#queryInput::placeholder {
    color: var(--text-light);
}

.send-button {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .input-form {
        padding: 20px 30px;
    }
    
    .input-wrapper {
        gap: 12px;
        padding: 12px 16px;
    }
    
    #queryInput {
        font-size: 15px;
    }
    
    .send-button {
        width: 44px;
        height: 44px;
    }
}

.send-button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-button:disabled {
    background: var(--border);
    cursor: not-allowed;
}

.send-button svg {
    width: 20px;
    height: 20px;
}

/* ========== Footer Info ========== */
.footer-info {
    padding: 10px 20px;
    background: var(--bg-main);
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}

.footer-info p {
    font-size: 11px;
    color: var(--text-gray);
}

@media (min-width: 768px) {
    .footer-info {
        padding: 12px 30px;
    }
    
    .footer-info p {
        font-size: 13px;
    }
}

/* ========== Scrollbar ========== */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .header {
        padding: 16px 20px;
    }

    .logo-icon {
        font-size: 36px;
    }

    .logo-text h1 {
        font-size: 20px;
    }

    .chat-messages {
        padding: 20px;
    }

    .welcome-card {
        padding: 30px 20px;
    }

    .message-content {
        max-width: 90%;
        font-size: 14px;
    }

    .input-form {
        padding: 16px 20px;
    }
}
