/* ================= GLOBAL STYLING ASSIGNMENTS ================= */
.serp-app-body {
    background-color: #f8fafc;
    color: #1e293b;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
    .serp-app-body {
        padding: 2rem;
    }
}

/* Base Wrapper Matrix Grid Structure Layout Container */
.serp-main-workspace-card {
    display: grid;
    grid-cols: 1;
    width: 100%;
    max-width: 72rem; /* max-w-6xl */
    gap: 2rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) {
    .serp-main-workspace-card {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        padding: 2rem;
    }
}

/* ================= COMPONENT INPUT STYLINGS ================= */
.serp-input-field {
    width: 100%;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #0f172a;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.serp-input-field:focus {
    background-color: #ffffff;
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
}

.serp-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(248, 250, 252, 0.5);
    padding: 0.625rem;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
    transition: background-color 150ms ease;
}

.serp-toggle-label:hover {
    background-color: #f8fafc;
}

/* Layout State Control Buttons */
.serp-toggle-btn {
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 150ms ease;
}

.serp-toggle-btn.active {
    background-color: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.serp-toggle-btn.inactive {
    color: #64748b;
}

.serp-toggle-btn.inactive:hover {
    color: #0f172a;
}

/* ================= PIXEL-PERFECT GOOGLE RESULTS EMULATOR ================= */
.google-view-desktop {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    padding: 1.25rem;
    box-shadow: 0 1px 6px rgba(32,33,36,0.05);
    color: #202124;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.5rem;
    max-width: 652px;
}

.google-view-mobile {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(32,33,36,0.08);
    color: #202124;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.75rem;
    max-width: 375px;
}

/* Strict Title Rules (Google Specs: Font Size, Hover Accent, Line Heights) */
.google-title-trunc {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1a0dab;
    font-family: Arial, sans-serif;
    font-size: 20px;
    line-height: 26px;
    font-weight: normal;
    margin-bottom: 4px;
}

.google-title-trunc:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* Strict Description Rules (Google Specs) */
.google-desc-trunc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #4d5156;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 22px;
    word-break: break-all;
}

/* Auto-Generated Highlights Injector Class Target */
.google-desc-trunc strong,
.google-title-trunc strong {
    color: #202124;
    font-weight: bold;
}

/* Add scrollbar treatment to control layouts safely if fields overflow vertical viewport heights */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Ensure code components wrap safely inside previews */
#technical-header-preview,
#technical-footer-preview {
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #1e293b;
}

/* Ensure the application layout wraps the structural footer cleanly */
.serp-app-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 0 !important; /* Drops full bleed container across window widths */
    background-color: #f8fafc;
}

/* Restores consistent page layout padding around your main simulator panel */
.serp-main-workspace-card {
    margin: 2rem auto;
    width: calc(100% - 2rem);
}

@media (min-width: 768px) {
    .serp-main-workspace-card {
        margin: 4rem auto;
        width: calc(100% - 4rem);
    }
}

/* Footer Content Copy Optimization Rules */
footer strong {
    color: #f8fafc;
    font-weight: 600;
}

footer p {
    text-rendering: optimizeLegibility;
}