/* ==========================================================================
   Text Uni Master Stylesheet - Mobile Optimized & AdSense Compliant
   ========================================================================== */

/* Core Variables */
:root {
    --bg-main: #ffffff;
    --bg-panel: #f9fafb;
    --text-dark: #222222;
    --text-body: #555555;
    --border-color: #eaeaea;
    --cyan-primary: #00b4d8;
    --cyan-hover: #0096c7;
    --cyan-light: #e0f7fa;
    --blue-dark: #0077b6;
    --danger: #ef4444;
}

/* Universal Reset & Mobile Safety Bounds */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.6;
}

/* Header & Navigation */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.logo span { color: var(--cyan-primary); }

.btn-coffee {
    background: #ffdd00;
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(255, 221, 0, 0.3);
    transition: transform 0.2s;
    white-space: nowrap;
}
.btn-coffee:hover { transform: translateY(-1px); }

/* Main Page Wrapper */
.page-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 24px;
}

/* Layout Container */
.workbench-layout-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
}

/* Sticky Ad Skyscraper Sidebars */
.ad-sidebar { 
    width: 160px; 
    flex-shrink: 0; 
}

.ad-sticky-box {
    position: sticky;
    top: 75px;
    width: 160px;
    height: 600px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-tag { font-size: 0.75rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; }

/* Workbench Split Layout */
.workbench-split {
    flex: 1;
    display: flex;
    gap: 20px;
    min-width: 0;
}

.left-panel, .right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Original 6 Quick Stats Grid (Preserved Original Dimensions) */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.stat-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 8px 4px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-body);
    font-weight: 500;
}

.stat-box span {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cyan-primary);
}

/* Single-Line Fixed Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 6px 8px;
    min-height: 42px;
    -webkit-overflow-scrolling: touch;
}

.editor-toolbar::-webkit-scrollbar {
    display: none;
}

.toolbar-group { 
    display: flex; 
    align-items: center;
    gap: 4px; 
    flex-shrink: 0;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.8rem;
    line-height: 1;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tool-btn:hover { background: var(--bg-panel); border-color: var(--border-color); }
.danger-text { color: var(--danger); }
.danger-text:hover { background: #fee2e2; border-color: #fca5a5; }

textarea {
    flex: 1;
    width: 100%;
    min-height: 480px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    padding: 16px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--bg-panel);
    color: var(--text-dark);
    resize: none;
    outline: none;
    line-height: 1.6;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

textarea:focus { border-color: var(--cyan-primary); background-color: #ffffff; }

/* Tool Modules */
.tool-module {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    min-width: 0;
}

.tool-module h3 { font-size: 0.9rem; color: var(--text-dark); margin-bottom: 8px; }

.btn-grid-9 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.btn-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.btn-transform {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.78rem;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-transform:hover {
    background: var(--cyan-light);
    color: var(--cyan-primary);
    border-color: var(--cyan-primary);
}

/* Find and Replace Box */
.find-replace-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.find-replace-box input {
    flex: 1 1 120px;
    min-width: 0;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    font-size: 0.8rem;
    box-sizing: border-box;
}

.find-replace-box input:focus { border-color: var(--cyan-primary); }

.btn-primary-small {
    flex: 1 1 100%;
    background: var(--cyan-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary-small:hover { background: var(--cyan-hover); }

/* Scrollable Keyword Density Box */
.density-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-height: 80px;
    overflow-y: auto;
    padding-right: 4px;
}

.density-container::-webkit-scrollbar { width: 4px; }
.density-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.density-empty { font-size: 0.78rem; color: #888; font-style: italic; }

.density-badge {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 0.75rem;
    color: var(--text-dark);
    font-weight: 600;
}

.density-badge span { color: var(--cyan-primary); margin-left: 3px; }

/* Platform Limits */
.progress-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 8px; 
}

.progress-card { 
    background: var(--bg-panel); 
    padding: 6px 8px; 
    border-radius: 6px; 
    border: 1px solid var(--border-color); 
}

.progress-header { 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.72rem; 
    margin-bottom: 4px; 
    font-weight: 600; 
    color: var(--text-dark); 
}

.progress-bar { 
    height: 5px; 
    background: var(--border-color); 
    border-radius: 3px; 
    overflow: hidden; 
}

.progress-fill { 
    height: 100%; 
    width: 0%; 
    background: var(--cyan-primary); 
    transition: width 0.3s; 
}

.progress-fill.over-limit { background: var(--danger); }

/* Horizontal Banners & In-Content Ads */
.mid-banner-ad, .content-ad-unit { 
    margin: 25px 0; 
    display: flex; 
    justify-content: center; 
    width: 100%;
}

.ad-horizontal-box {
    width: 100%;
    max-width: 970px;
    height: 90px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Area */
.landing-content-wrapper { 
    width: 100%; 
    background-color: #f9fafb; 
    padding: 60px 24px; 
    border-top: 1px solid #eaeaea; 
}

.landing-container { 
    max-width: 1000px; 
    margin: 0 auto; 
    text-align: center; 
}

.landing-container h2.main-title { 
    color: #222222; 
    font-size: 32px; 
    font-weight: 700; 
    margin-bottom: 12px; 
}

.landing-container p.main-subtitle { 
    color: #555555; 
    font-size: 16px; 
    max-width: 750px; 
    margin: 0 auto 40px auto; 
}

.feature-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 24px; 
    margin-bottom: 30px; 
    text-align: left; 
}

.feature-card { 
    background: #ffffff; 
    padding: 25px; 
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); 
    border: 1px solid #f0f0f0; 
}

.icon-box { 
    width: 45px; 
    height: 45px; 
    background: #e0f7fa; 
    color: #00b4d8; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 10px; 
    font-size: 22px; 
    margin-bottom: 15px; 
}

.white-block-section { 
    text-align: left; 
    background: #ffffff; 
    padding: 35px; 
    border-radius: 14px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); 
    border: 1px solid #f0f0f0; 
    margin-bottom: 30px; 
}

.white-block-section h2.block-title, 
.white-block-section h2.faq-title { 
    color: #222; 
    font-size: 26px; 
    margin-bottom: 20px; 
    font-weight: 700; 
}

.faq-item { margin-bottom: 24px; }
.faq-item h3 { color: #00b4d8; font-size: 18px; margin-bottom: 8px; }

/* CTA & Live Counter Split */
.cta-bottom-split {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    padding: 40px 35px;
    border-radius: 16px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    box-shadow: 0 12px 25px rgba(0, 180, 216, 0.2);
}

.cta-left-stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.live-text {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.visitor-count-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 6px 0;
}

.visitor-label {
    font-size: 0.88rem;
    opacity: 0.9;
    font-weight: 500;
}

.cta-right-action {
    flex: 1.2;
    text-align: left;
}

.cta-right-action h2 {
    color: #ffffff;
    font-size: 26px;
    margin-bottom: 8px;
    font-weight: 700;
}

.cta-right-action p {
    font-size: 15px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.cta-btn-large {
    background: #ffffff;
    color: #0077b6;
    padding: 12px 30px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* Single-Line Centered Footer */
.footer { 
    background: #ffffff; 
    border-top: 1px solid var(--border-color); 
    padding: 20px 24px; 
}

.footer-container { 
    width: 100%; 
    max-width: 1400px;
    margin: 0 auto;
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.footer-brand p {
    font-size: 0.88rem;
    color: var(--text-body);
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-nav a { 
    color: var(--text-body); 
    text-decoration: none; 
    font-size: 0.88rem; 
    white-space: nowrap;
}

.footer-nav a:hover { color: var(--cyan-primary); }

/* Mobile & Tablet Responsiveness */
@media (max-width: 1300px) {
    .ad-sidebar { display: none; }
}

@media (min-width: 576px) {
    .btn-primary-small {
        flex: 0 0 auto;
    }
}

@media (max-width: 1024px) {
    .workbench-split { 
        flex-direction: column; 
    }
    .quick-stats { 
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (max-width: 900px) {
    .cta-bottom-split {
        flex-direction: column;
        text-align: center;
    }
    .cta-right-action {
        text-align: center;
    }
}

@media (max-width: 500px) {
    .navbar {
        padding: 8px 12px;
    }
    .logo {
        font-size: 1.25rem;
    }
    .btn-coffee {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    .page-wrapper {
        padding: 10px 12px;
    }
    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .btn-grid-9, .btn-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    .progress-grid {
        grid-template-columns: 1fr;
    }
    .tool-btn {
        padding: 4px 5px;
        font-size: 0.72rem;
    }
}
