/* =============================================
   DigiTechGenAI - JSON Tools Suite
   Brand Colors:
   - Primary Dark:   #0a3d62 (deep teal/navy hero)
   - Primary Mid:    #0d5c8a (mid blue)
   - Accent Blue:    #2980f5 (bright blue CTA button)
   - Cyan Top Bar:   #17a2b8
   - Dark Grey:      #5a5a5a (secondary button)
   - White:          #ffffff (nav background)
   - Text Dark:      #1a1a2e
============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:      #0a3d62;
    --primary-mid:  #0d5c8a;
    --accent:       #2980f5;
    --cyan:         #17a2b8;
    --dark-grey:    #5a5a5a;
    --white:        #ffffff;
    --bg-light:     #f5f7fa;
    --text-dark:    #1a1a2e;
    --text-mid:     #444;
    --text-light:   #888;
    --border:       #e0e6ef;
    --success-bg:   #d4edda;
    --success-text: #155724;
    --success-border:#28a745;
    --error-bg:     #f8d7da;
    --error-text:   #721c24;
    --error-border: #f5c6cb;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-mid);
    line-height: 1.6;
    min-height: 100vh;
}

/* =============================================
   TOP BAR
============================================= */
.top-bar {
    background: var(--cyan);
    padding: 6px 0;
    font-size: 13px;
}

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

.social-links {
    display: flex;
    gap: 14px;
}

.social-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.social-links a:hover {
    opacity: 1;
}

.contact-info {
    color: white;
    font-size: 13px;
}

.contact-info a {
    color: white;
    font-weight: 600;
    text-decoration: none;
}

/* =============================================
   NAVBAR
============================================= */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-logo img {
    height: 45px;
    width: auto;
}

.logo-fallback {
    display: none;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    font-weight: 800;
    font-size: 14px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
}

.navbar-menu {
    display: flex;
    gap: 28px;
    list-style: none;
}

.navbar-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

.navbar-menu a:hover {
    color: var(--accent);
}

.navbar-menu a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-dark);
}

/* =============================================
   HERO SECTION
============================================= */
.hero {
    background: linear-gradient(135deg, #0a3d62 0%, #0d2137 60%, #0a4d6e 100%);
    color: white;
    padding: 60px 20px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-light);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 24px;
    line-height: 1.7;
    letter-spacing: 0.3px;
}

.hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* =============================================
   BREADCRUMB
============================================= */
.breadcrumb {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-size: 13px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* =============================================
   MAIN CONTENT
============================================= */
.main-content {
    padding: 30px 20px 60px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(10,61,98,0.10);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* =============================================
   TABS
============================================= */
.tabs {
    display: flex;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 16px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.25s ease;
    border-bottom: 3px solid transparent;
    letter-spacing: 0.2px;
}

.tab-btn:hover {
    background: white;
    color: var(--primary);
}

.tab-btn.active {
    background: white;
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* =============================================
   TAB CONTENT
============================================= */
.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.tab-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.tab-desc {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* =============================================
   EDITOR GRID
============================================= */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.editor-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-box label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================
   TEXTAREA
============================================= */
.textarea {
    width: 100%;
    height: 260px;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    resize: vertical;
    color: var(--text-dark);
    background: #fafcff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    line-height: 1.6;
}

.textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(41,128,245,0.12);
    background: white;
}

.textarea[readonly] {
    background: var(--bg-light);
    color: var(--text-mid);
    cursor: default;
}

/* =============================================
   BUTTONS
============================================= */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.btn {
    padding: 11px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(41,128,245,0.25);
}

.btn-primary:hover {
    background: #1a6fd4;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(41,128,245,0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--primary);
}

.btn-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(10,61,98,0.2);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(10,61,98,0.3);
}

.indent-select {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    font-weight: 500;
}

.indent-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* =============================================
   MESSAGES
============================================= */
.error-message {
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 6px;
    color: var(--error-text);
    font-size: 13px;
    margin-top: 10px;
    display: none;
    font-family: 'Courier New', monospace;
}

.error-message.show {
    display: block;
}

.validation-result {
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    min-height: 80px;
    display: none;
    font-weight: 500;
}

.validation-result.show {
    display: block;
}

.validation-result.valid {
    background: var(--success-bg);
    border: 1.5px solid var(--success-border);
    color: var(--success-text);
}

.validation-result.invalid {
    background: var(--error-bg);
    border: 1.5px solid var(--error-border);
    color: var(--error-text);
    font-family: 'Courier New', monospace;
}

.stats-box {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    flex-wrap: wrap;
}

/* =============================================
   SEO CONTENT SECTION
============================================= */
.seo-section {
    margin-top: 40px;
}

.seo-container {
    max-width: 1100px;
    margin: 0 auto;
}

.seo-container h2 {
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 700;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.seo-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(10,61,98,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(10,61,98,0.12);
}

.seo-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.seo-card p {
    font-size: 14px;
    color: var(--text-mid);
    line-height: 1.7;
}

/* =============================================
   FOOTER
============================================= */
.footer {
    background: linear-gradient(135deg, #0a3d62 0%, #0d2137 100%);
    color: white;
    padding: 50px 20px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--cyan);
}

.footer-col p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.7;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-col ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    opacity: 0.7;
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 900px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar-container {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .navbar-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 75px;
        left: 0;
        right: 0;
        background: white;
        padding: 20px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
        gap: 16px;
    }

    .navbar-menu.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .navbar {
        position: relative;
    }

    .hero h1 {
        font-size: 24px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
        text-align: left;
    }

    .tab-btn.active {
        border-left-color: var(--accent);
        border-bottom: none;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .seo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 16px;
    }

    .tab-content {
        padding: 20px 16px;
    }

    .textarea {
        height: 200px;
    }
}
