/* --- GLOBAL THEME (Green UI) --- */
:root { 
    --primary: #4caf50; 
    --primary-dark: #388e3c; 
    --secondary: #2196f3; 
    --dark: #2c3e50; 
    --light: #f4f7f6; 
    --white: #ffffff; 
    --shadow: 0 10px 30px rgba(0,0,0,0.08); 
    --gradient: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%); 
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: 'Poppins', sans-serif; background: var(--light); color: #333; overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; }

/* --- HEADER --- */
header { background: var(--white); padding: 15px 5%; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 15px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.logo { font-size: 24px; font-weight: 800; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo img { width: 30px; height: 30px; }
.logo span { color: var(--dark); }

/* Desktop Nav */
.desktop-nav { display: flex; gap: 25px; align-items: center; }
.desktop-nav a { text-decoration: none; color: var(--dark); font-weight: 500; font-size: 15px; transition: 0.3s; }
.desktop-nav a:hover { color: var(--primary); }

/* Mobile Menu Btn */
.mobile-menu-btn { display: none; font-size: 24px; background: none; border: none; cursor: pointer; color: var(--dark); }

/* Mobile Dropdown */
.mobile-nav { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: white; flex-direction: column; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-top: 1px solid #eee; z-index: 999; }
.mobile-nav a { padding: 15px; text-decoration: none; color: #333; border-bottom: 1px solid #f0f0f0; font-weight: 500; font-size: 16px; }
.mobile-nav.active { display: flex; }

/* --- TOOL NAV (Glassmorphism) --- */
.tool-nav { display: flex; gap: 12px; padding: 20px; max-width: 1200px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.tool-nav::-webkit-scrollbar { display: none; }
.tool-card { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); padding: 12px 20px; border-radius: 50px; text-decoration: none; color: var(--dark); display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); white-space: nowrap; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.5); transition: 0.3s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.tool-card.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3); }

/* --- MAIN CONTAINER --- */
.main-container { max-width: 1100px; margin: 30px auto; padding: 0 20px; flex: 1; width: 100%; }
.app-box { background: var(--white); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.app-box::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: var(--gradient); }

/* --- TRANSLATOR / TYPING TABS --- */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid #eee; margin-bottom: 25px; padding-bottom: 10px; }
.tab { font-weight: 600; color: #777; cursor: pointer; padding: 8px 15px; border-radius: 8px; transition: 0.3s; }
.tab:hover { background: #f5f5f5; color: var(--dark); }
.tab.active { color: var(--primary); background: #e8f5e9; }
.content-tab { display: none; animation: fadeIn 0.4s ease; }
.content-tab.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- EDITOR LAYOUT --- */
.lang-header { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 20px; font-weight: 700; color: #555; }
.lang-badge { background: #f0f0f0; padding: 8px 20px; border-radius: 50px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.lang-badge img { width: 20px; }

.editor-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-wrapper { border: 2px solid #eee; border-radius: 18px; background: #fafafa; overflow: hidden; transition: 0.3s; display: flex; flex-direction: column; height: 350px; }
.editor-wrapper:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1); }
textarea { flex: 1; width: 100%; padding: 20px; border: none; outline: none; font-size: 18px; resize: none; background: transparent; font-family: inherit; line-height: 1.6; }

.actions { display: flex; gap: 10px; padding: 12px 20px; background: #fff; border-top: 1px solid #eee; justify-content: space-between; align-items: center; }
.action-group { display: flex; gap: 10px; }
.btn-circle { width: 40px; height: 40px; border-radius: 50%; border: none; background: #f5f5f5; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #555; transition: 0.2s; font-size: 16px; }
.btn-circle:hover { background: var(--primary); color: white; transform: scale(1.1); }
.char-count { font-size: 12px; color: #999; font-weight: 500; }

.btn-translate-mobile { display: none; width: 100%; padding: 15px; background: var(--gradient); color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; margin: 20px 0; box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3); }

/* --- HISTORY --- */
.history-item { background: #fff; padding: 15px; border-radius: 12px; margin-bottom: 12px; border: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
.history-item:hover { border-color: var(--primary); transform: translateX(5px); }
.history-content { flex: 1; margin-right: 15px; }
.history-src { font-size: 14px; color: #666; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.history-dest { font-weight: 600; color: var(--dark); font-size: 16px; }
.history-actions button { background: none; border: none; cursor: pointer; color: #999; padding: 5px; transition: 0.2s; }
.history-actions button:hover { color: var(--primary); }

/* --- SEO CONTENT & SIDEBAR --- */
.seo-container { margin-top: 50px; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.content-section { background: white; border-radius: 20px; padding: 40px; box-shadow: var(--shadow); }
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.content-section h1 { font-size: 28px; color: var(--dark); margin-bottom: 20px; line-height: 1.4; }
.content-section h2 { font-size: 22px; color: var(--primary-dark); margin-top: 30px; margin-bottom: 15px; }
.content-section p { line-height: 1.8; color: #555; margin-bottom: 20px; font-size: 16px; text-align: justify; }
.content-section ul { padding-left: 20px; margin-bottom: 20px; }
.content-section li { margin-bottom: 10px; color: #555; position: relative; list-style: none; padding-left: 25px; }
.content-section li::before { content: '✔'; color: var(--primary); font-weight: bold; position: absolute; left: 0; }

/* Widgets */
.widget { background: white; padding: 25px; border-radius: 15px; box-shadow: var(--shadow); border-top: 4px solid var(--primary); }
.widget h3 { margin-top: 0; color: var(--dark); font-size: 18px; margin-bottom: 15px; }
.link-list a { display: block; padding: 10px 0; border-bottom: 1px dashed #eee; text-decoration: none; color: #555; font-size: 14px; transition: 0.2s; }
.link-list a:hover { color: var(--primary); padding-left: 5px; }
.link-list a:last-child { border-bottom: none; }

/* FAQ Accordion */
.faq-item { border: 1px solid #eee; border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.faq-btn { width: 100%; text-align: left; padding: 15px 20px; background: #fafafa; border: none; font-size: 16px; font-weight: 600; color: var(--dark); cursor: pointer; display: flex; justify-content: space-between; transition: 0.3s; }
.faq-btn:hover { background: #f0f0f0; }
.faq-content { display: none; padding: 20px; color: #666; line-height: 1.6; background: #fff; border-top: 1px solid #eee; }
.faq-item.active .faq-content { display: block; }
.faq-item.active .faq-btn { background: var(--primary); color: white; }

/* --- FOOTER --- */
footer { background: var(--dark); color: white; padding: 50px 5% 20px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; max-width: 1200px; margin: 0 auto; }
.footer-logo { font-size: 24px; font-weight: 800; color: var(--primary); margin-bottom: 15px; display: block; text-decoration: none; }
.footer-desc { color: #aaa; line-height: 1.6; font-size: 14px; }
.footer-links h4 { color: #fff; margin-bottom: 20px; font-size: 18px; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #ccc; text-decoration: none; font-size: 14px; transition: 0.2s; }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }
.copy-right { text-align: center; padding-top: 30px; margin-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; opacity: 0.6; }
.visitor-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); padding: 8px 20px; border-radius: 50px; font-size: 13px; margin-top: 20px; border: 1px solid rgba(255,255,255,0.2); }

/* --- TOAST --- */
.toast { position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 12px 30px; border-radius: 50px; font-size: 14px; transition: 0.4s; z-index: 2000; box-shadow: 0 5px 15px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 10px; }
.toast.show { bottom: 30px; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .editor-container { grid-template-columns: 1fr; }
    .btn-translate-mobile { display: block; }
    .seo-container { grid-template-columns: 1fr; }
    .app-box { padding: 20px; }
    .desktop-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .editor-wrapper { height: 200px; }
}