/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    padding: 1rem 0;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo i {
    font-size: 2rem;
    color: #2E7D4F;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2E7D4F;
}

.header-subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 400;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 3rem;
}

.welcome-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-icon {
    font-size: 3rem;
    color: #2E7D4F;
    margin-bottom: 1rem;
}

.welcome-card h2 {
    font-size: 2rem;
    color: #2E7D4F;
    margin-bottom: 1rem;
    font-weight: 600;
}

.welcome-card p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.emergency-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.emergency-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #856404;
    margin-bottom: 0.5rem;
}

.emergency-number i {
    color: #dc3545;
}

.emergency-info small {
    color: #856404;
    font-size: 0.9rem;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 3rem;
}

.quick-actions h3 {
    text-align: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 2rem;
    font-weight: 600;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.action-card i {
    font-size: 2.5rem;
    color: #2E7D4F;
    margin-bottom: 0.5rem;
}

.action-card span {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Chat Section */
.chat-section {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.chat-header {
    background: #2E7D4F;
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 1rem;
    border-radius: 16px;
    word-wrap: break-word;
}

.message.user {
    background: #2E7D4F;
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 4px;
}

.message.bot {
    background: #f8f9fa;
    color: #333;
    align-self: flex-start;
    border-bottom-right-radius: 4px;
    border: 1px solid #e9ecef;
}

.message-time {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#messageInput {
    flex: 1;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

#messageInput:focus {
    border-color: #2E7D4F;
}

.send-btn {
    background: #2E7D4F;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #245c3a;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-reply {
    background: white;
    border: 1px solid #2E7D4F;
    color: #2E7D4F;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.quick-reply:hover {
    background: #2E7D4F;
    color: white;
}

/* Information Section */
.info-section {
    margin-bottom: 3rem;
}

.info-section h3 {
    text-align: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 2rem;
    font-weight: 600;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-icon {
    font-size: 2.5rem;
    color: #2E7D4F;
    margin-bottom: 1rem;
}

.info-card h4 {
    font-size: 1.3rem;
    color: #2E7D4F;
    margin-bottom: 1rem;
    font-weight: 600;
}

.info-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.info-card button {
    background: #2E7D4F;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    font-family: inherit;
}

.info-card button:hover {
    background: #245c3a;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

/* Offline Message */
.offline-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff6b6b;
    color: white;
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2E7D4F;
    color: white;
    padding: 1rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.install-banner.show {
    transform: translateY(0);
}

.install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.install-actions {
    display: flex;
    gap: 0.5rem;
}

.install-btn, .dismiss-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
}

.install-btn {
    background: white;
    color: #2E7D4F;
    font-weight: 600;
}

.dismiss-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .header-subtitle {
        font-size: 0.9rem;
    }
    
    .welcome-card {
        padding: 2rem 1.5rem;
    }
    
    .welcome-card h2 {
        font-size: 1.6rem;
    }
    
    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .action-card {
        padding: 1.5rem 1rem;
    }
    
    .action-card i {
        font-size: 2rem;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .install-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .welcome-card {
        padding: 1.5rem;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions h3,
    .info-section h3 {
        font-size: 1.3rem;
    }
}