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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* RTL/LTR Support Structure */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Page System */
.page {
    display: none;
    padding-top: 80px;
    min-height: 100vh;
    animation: fadeIn 0.5s ease-in;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Landing Page */
.hero-section {
    text-align: center;
    padding: 4rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: 1.2rem;
    color: white;
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.8;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.choice-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.choice-container h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #333;
}

.choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.choice-btn {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.choice-btn:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.choice-btn.native {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.choice-btn.native:hover {
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.choice-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.choice-btn h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.choice-btn p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Categories Page */
.page-title {
    font-size: 2.5rem;
    color: white;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    font-size: 1.2rem;
    color: white;
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0.9;
}

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

.category-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-image {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.category-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Category Detail Page */
.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-btn:hover {
    background: white;
    color: #667eea;
}

.category-header {
    text-align: center;
    margin-bottom: 3rem;
}

.category-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.category-header p {
    font-size: 1.1rem;
    color: white;
    opacity: 0.9;
}

.content-sections {
    display: grid;
    gap: 2rem;
}

.section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.section-content {
    line-height: 1.6;
}

/* Vocabulary Grid */
.vocabulary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.vocab-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid #667eea;
}

.vocab-word {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.vocab-meaning {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.gallery-emoji {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.gallery-caption {
    font-size: 0.9rem;
    color: #666;
}

/* Chat Section */
.chat-container {
    max-width: 600px;
    margin: 0 auto;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fafafa;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.message-avatar.user {
    background: #28a745;
}

.message-content {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 15px;
    max-width: 70%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.message-content.user {
    background: #667eea;
    color: white;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#chat-input:focus {
    border-color: #667eea;
}

#send-btn {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#send-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .choice-buttons {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-buttons {
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}