/* === RESET & BASE === */
* { box-sizing: border-box; outline: none; }
body { font-family: 'Montserrat', sans-serif; margin: 0; min-height: 100vh; display: flex; flex-direction: column; background-color: #f3f4f6; color: #374151; }
textarea, input, .output-div { font-family: 'Montserrat', sans-serif !important; }
.custom-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f1f1f1; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* === HEADER === */
.app-header { background: white; border-bottom: 1px solid #e5e7eb; padding: 0 20px; height: 60px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; z-index: 100; position: sticky; top: 0; }
.header-left { flex: 1.5; }
.header-center { flex: 2; display: flex; justify-content: center; height: 100%; }
.header-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.header-left h1 { margin: 0; font-size: 16px; color: #111827; font-weight: 700; margin-bottom: 4px; }
.donate-info { font-size: 11px; display: flex; align-items: center; gap: 5px; }
.donate-label { background: #dc2626; color: white; padding: 2px 6px; border-radius: 4px; font-weight: 800; font-size: 10px; animation: pulse-red 2s infinite; }
.donate-details { color: #b91c1c; font-weight: 700; font-size: 12px; letter-spacing: 0.5px; }
@keyframes pulse-red { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }

/* === TABS === */
.tabs { display: flex; gap: 5px; height: 100%; align-items: flex-end; }
.tab-button { border: none; background: transparent; padding: 0 25px; height: 45px; cursor: pointer; font-weight: 600; color: #6b7280; border-bottom: 3px solid transparent; transition: all 0.2s; font-size: 13px; text-transform: uppercase; }
.tab-button:hover { color: #2563eb; background: #f9fafb; }
.tab-button.active { color: #2563eb; border-bottom-color: #2563eb; background: linear-gradient(to top, #eff6ff, transparent); }

/* === MAIN === */
.app-body { flex: 1; padding: 15px; display: flex; flex-direction: column; height: auto; }
.tab-content { display: none; width: 100%; flex-direction: column; }
.tab-content.active { display: flex; }

/* === BUTTONS === */
.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #2563eb; color: white; } .btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #10b981; color: white; } .btn-success:hover { background: #059669; }
.btn-warning { background: #f59e0b; color: white; } .btn-warning:hover { background: #d97706; }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* Modern Flat Buttons */
.btn-modern { border: 1px solid transparent; padding: 8px 15px; justify-content: center; }
.btn-modern-primary { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; } .btn-modern-primary:hover { background: #dbeafe; }
.btn-modern-secondary { background: #f3f4f6; color: #374151; border-color: #e5e7eb; } .btn-modern-secondary:hover { background: #e5e7eb; }
.btn-modern-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; } .btn-modern-warning:hover { background: #fef3c7; }
.btn-modern-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; } .btn-modern-danger:hover { background: #fee2e2; }
.btn-modern-purple { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; } .btn-modern-purple:hover { background: #e9d5ff; }

/* Action Buttons */
.btn-action-green { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; } .btn-action-green:hover { background: #a7f3d0; }
.btn-action-blue { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; } .btn-action-blue:hover { background: #bfdbfe; }

/* TOGGLE BUTTONS - OLD STYLE */
.btn-toggle { background: #e5e7eb; color: #6b7280; justify-content: flex-start; min-width: 140px; border: 1px solid #d1d5db; }
.btn-toggle.active { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; font-weight: 700; }

.hidden { display: none !important; }
.full-width { width: 100%; }
.icon-btn { min-width: 120px; }
.input-with-btn { display: flex; gap: 5px; align-items: center; width: 100%; }
.badge { background: #1abc9c; color: white; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-yellow { background: #f59e0b; color: white; }
.badge-blue { background: #3b82f6; color: white; }
.counters-group { display: flex; gap: 5px; align-items: center; }
.limit-label { font-size: 10px; color: #ef4444; font-weight: 600; margin-left: 5px; font-style: italic; }
.limit-label.vip { color: #059669; }

/* SETTINGS PANE */
.panel-container { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex; flex-direction: column; max-width: 1000px; margin: 0 auto; width: 100%; }
.panel-header { padding: 15px 20px; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; }
.panel-header h2 { margin: 0; font-size: 16px; color: #111827; }
.mode-actions { display: flex; gap: 8px; align-items: center; }
.select-wrapper { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-right: 10px; }
#mode-select { padding: 6px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; }
.toolbar { padding: 10px 20px; background: #f9fafb; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.toolbar-group { display: flex; gap: 8px; }
.advanced-settings { padding: 15px 20px; background: #fff; border-bottom: 1px solid #f3f4f6; display: flex; flex-direction: column; gap: 10px; }
.setting-block { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.setting-block label { font-size: 12px; font-weight: 600; color: #4b5563; }
.setting-block input[type="text"] { padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; width: 100%; }
.list-actions { padding: 10px 20px; display: flex; gap: 10px; }
.scroll-area { padding: 10px 20px; background: #f9fafb; min-height: 200px; }

/* PAIRS LIST */
.punctuation-item { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; background: white; padding: 6px 10px; border-radius: 6px; border: 1px solid #e5e7eb; }
.pair-index { font-size: 11px; font-weight: 700; color: #9ca3af; width: 25px; text-align: right; margin-right: 5px; }
.punctuation-item input { flex: 1; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 4px; font-size: 13px; }
.punctuation-item button.remove { width: 28px; height: 28px; border-radius: 4px; border: 1px solid #fecaca; background: #fef2f2; color: #dc2626; cursor: pointer; transition: all 0.2s; }
.punctuation-item button.remove:hover { background: #dc2626; color: white; border-color: #b91c1c; transform: scale(1.1); box-shadow: 0 2px 4px rgba(220,38,38,0.3); }

/* REPLACE PANE */
#replace { height: calc(100vh - 100px); } 
.split-pane { display: flex; gap: 15px; height: 100%; min-height: 0; }
.pane { flex: 1; display: flex; flex-direction: column; background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow: hidden; height: 100%; min-height: 0; }
.pane-header { padding: 10px 15px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.pane textarea { flex: 1; border: none; padding: 15px; resize: none; font-size: 15px; line-height: 1.6; color: #333; overflow-y: auto; min-height: 0; }
.output-div { flex: 1; border: none; padding: 15px; font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-y: auto; background-color: #fff; color: #374151; word-wrap: break-word; min-height: 0; }
.output-div:empty::before { content: attr(data-placeholder); color: #9ca3af; pointer-events: none; }
.pane-footer { padding: 10px; border-top: 1px solid #e5e7eb; background: #f9fafb; flex-shrink: 0; }
mark.hl-yellow { background-color: #fde047; color: #000; border-radius: 2px; padding: 0 1px; border-bottom: 2px solid #eab308; display: inline; }
mark.hl-blue { background-color: #93c5fd; color: #000; border-radius: 2px; padding: 0 1px; border-bottom: 2px solid #3b82f6; display: inline; }
mark.hl-orange { background-color: #fdba74; color: #000; border-radius: 2px; padding: 0 1px; border-bottom: 2px solid #f97316; display: inline; }

/* SPLIT TAB */
.split-controls-wrapper { background: white; padding: 10px 15px; border-radius: 8px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.split-mode-selector { display: flex; gap: 20px; font-size: 13px; font-weight: 600; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.split-mode-selector label { cursor: pointer; display: flex; align-items: center; gap: 5px; }
.split-sub-controls { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.split-buttons-group { display: flex; gap: 5px; flex-wrap: wrap; }
.split-mode-btn { width: 32px; height: 32px; border: 1px solid #d1d5db; background: white; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; }
.split-mode-btn.active { background: #2563eb; color: white; border-color: #2563eb; }
.split-mode-btn.faded { opacity: 0.4; cursor: not-allowed; } 
#split-regex-input { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 4px; width: 300px; font-family: monospace; }
.split-grid-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-content: start; }
.outputs-wrapper { display: contents; }
.split-box { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex; flex-direction: column; border: 1px solid #e5e7eb; height: 350px; }
.split-header { padding: 8px 12px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; }
.split-box textarea { flex: 1; border: none; padding: 10px; resize: none; font-size: 13px; overflow-y: auto; }
.split-footer { padding: 8px; border-top: 1px solid #e5e7eb; background: #f9fafb; }
@media (max-width: 1200px) { .split-grid-container { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .split-grid-container { grid-template-columns: 1fr; } }

/* NOTIFICATION */
#notification-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.notification { padding: 12px 20px; border-radius: 6px; color: white; font-size: 13px; font-weight: 600; box-shadow: 0 4px 8px rgba(0,0,0,0.15); animation: slideIn 0.3s ease-out; }
.notification.success { background: #10b981; border-left: 4px solid #047857; }
.notification.error { background: #ef4444; border-left: 4px solid #b91c1c; }
.notification.warning { background: #f59e0b; border-left: 4px solid #b45309; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: 0; opacity: 1; } }

/* VIP/LOCKED UI */
.locked-feature { opacity: 0.5; pointer-events: none; filter: grayscale(100%); cursor: not-allowed; }
.locked-wrapper { position: relative; display: inline-block; }
.locked-overlay { position: absolute; top: -8px; right: -8px; background: #ef4444; color: white; font-size: 9px; font-weight: bold; padding: 2px 5px; border-radius: 4px; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.vip-badge-info { font-size: 12px; font-weight: 700; color: #059669; background: #d1fae5; padding: 5px 10px; border-radius: 4px; display: flex; align-items: center; gap: 8px; }
.logout-btn { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600; text-decoration: none; }

/* MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: none; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal-box { background: white; width: 500px; padding: 25px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); position: relative; animation: slideInUp 0.3s ease-out; font-family: 'Montserrat', sans-serif; }
@keyframes slideInUp { from { transform: translateY(20px); opacity: 0; } to { transform: 0; opacity: 1; } }
.modal-close { position: absolute; top: 15px; right: 15px; border: none; background: none; font-size: 20px; cursor: pointer; color: #9ca3af; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 20px 0; }
.price-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 15px; text-align: center; color: #374151; }
.price-card.team { border-color: #3b82f6; background: #eff6ff; }
.price-title { font-weight: 800; font-size: 14px; margin-bottom: 5px; display: block; color: #111827; }
.buy-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
.btn-fb { background: #1877f2; color: white; width: 100%; text-decoration: none; padding: 10px; border-radius: 6px; font-weight: 700; font-size: 13px; text-align: center; display: block; }
.btn-tele { background: #0088cc; color: white; width: 100%; text-decoration: none; padding: 10px; border-radius: 6px; font-weight: 700; font-size: 13px; text-align: center; display: block; }
