:root {
    --lingo-primary: #f97316;
    --lingo-secondary: #3b82f6;
    --lingo-primary-light: #ffedd5;
    --lingo-secondary-light: #dbeafe;
    --lingo-gray: #f3f4f6;
    --lingo-text: #1f2937;
    --lingo-border: #e5e7eb;
}

.lingo-open-dict-btn {
    background: linear-gradient(135deg, var(--lingo-primary), var(--lingo-secondary));
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    display: inline-block;
}
.lingo-open-dict-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    color: white;
}

.lingo-dictionary-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Vazir', Tahoma, sans-serif;
    direction: rtl;
}

.lingo-welcome-message {
    background: linear-gradient(135deg, var(--lingo-primary-light), var(--lingo-secondary-light));
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 25px;
    text-align: center;
}
.lingo-welcome-message p {
    margin: 0;
    font-size: 18px;
    color: var(--lingo-text);
}

.lingo-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--lingo-border);
    padding-bottom: 10px;
}
.lingo-tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    color: var(--lingo-text);
}
.lingo-tab-btn.active {
    background: var(--lingo-primary);
    color: white;
}
.lingo-tab-content {
    display: none;
}
.lingo-tab-content.active {
    display: block;
}

.lingo-notebook-container {
    text-align: center;
    padding: 40px;
    background: var(--lingo-gray);
    border-radius: 16px;
}
.lingo-notebook-hint {
    margin-top: 15px;
    font-size: 14px;
    color: #6b7280;
}

/* استایل صفحه دفترچه */
.lingo-notebook-fullscreen {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}
.lingo-notebook-header h2 {
    margin-bottom: 20px;
}
.lingo-notebook-help {
    background: var(--lingo-primary-light);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

/* استایل لودینگ روی textarea */
.lingo-notebook-textarea-wrapper {
    position: relative;
    margin-bottom: 20px;
}
.lingo-notebook-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(249, 250, 251, 0.95);
    border: 1px solid var(--lingo-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    min-height: 400px;
}
.lingo-notebook-loading-spinner {
    font-size: 48px;
    animation: spin 1s linear infinite;
    display: inline-block;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.lingo-notebook-loading-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--lingo-primary);
    margin-top: 15px;
}
.lingo-notebook-loading-sub {
    font-size: 14px;
    color: #6b7280;
    margin-top: 5px;
}
.lingo-notebook-textarea {
    width: 100%;
    height: 500px;
    padding: 15px;
    font-size: 16px;
    font-family: monospace;
    border: 1px solid var(--lingo-border);
    border-radius: 12px;
    resize: vertical;
    direction: ltr;
    text-align: left;
    transition: opacity 0.3s ease;
}

.lingo-notebook-actions {
    margin-top: 20px;
    text-align: center;
}
.lingo-notebook-save-btn {
    background: var(--lingo-secondary);
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.lingo-notebook-save-btn:hover {
    background: var(--lingo-primary);
    transform: scale(1.02);
}
.lingo-notebook-message {
    margin-top: 15px;
    font-size: 14px;
}

/* تست یادگیری */
.lingo-test-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
}
.lingo-test-question {
    font-size: 20px;
    color: #6b7280;
    margin-bottom: 20px;
}
.lingo-test-word {
    font-size: 36px;
    font-weight: bold;
    color: var(--lingo-primary);
    margin-bottom: 15px;
    padding: 20px;
    background: var(--lingo-gray);
    border-radius: 16px;
}
.test-word-display {
    direction: ltr;
}
.lingo-test-meaning {
    font-size: 20px;
    color: var(--lingo-secondary);
    margin-bottom: 25px;
    padding: 15px;
    background: var(--lingo-secondary-light);
    border-radius: 12px;
}
.test-meaning-display {
    direction: rtl;
}
.lingo-test-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px auto;
    width: 100%;
    max-width: 400px;
}
.lingo-test-buttons .lingo-btn {
    flex: 1;
    padding: 10px 20px;
    font-size: 16px;
    min-width: 130px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}
.test-yes-btn {
    background: #10b981;
    color: white;
}
.test-yes-btn:hover {
    background: #059669;
    transform: scale(1.02);
}
.test-no-btn {
    background: #ef4444;
    color: white;
}
.test-no-btn:hover {
    background: #dc2626;
    transform: scale(1.02);
}
.lingo-test-feedback {
    margin-bottom: 20px;
}
.test-feedback {
    padding: 15px;
    border-radius: 12px;
}
.test-feedback.correct {
    background: #dcfce7;
    color: #166534;
}
.test-feedback.wrong {
    background: #fee2e2;
    color: #991b1b;
}
.test-message {
    font-size: 16px;
}
.lingo-empty {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}
.lingo-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* دکمه‌ها */
.lingo-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.lingo-btn-primary {
    background: var(--lingo-primary);
    color: white;
}
.lingo-btn-secondary {
    background: var(--lingo-secondary);
    color: white;
}
.lingo-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}
.lingo-btn-small-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.lingo-btn-small-danger:hover {
    background: #dc2626;
}
.lingo-btn:hover {
    opacity: 0.85;
    transform: scale(1.02);
}
.lingo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .lingo-dictionary-container {
        padding: 10px;
    }
    .lingo-test-word {
        font-size: 28px;
    }
    .lingo-test-buttons {
        gap: 12px;
        max-width: 300px;
    }
    .lingo-test-buttons .lingo-btn {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 100px;
    }
    .lingo-notebook-textarea {
        height: 400px;
    }
    .lingo-notebook-loading-overlay {
        min-height: 350px;
    }
}