:root {
    /* Colors */
    --primary-blue: #1a0dab;
    --url-green: #006621;
    --text-main: #202124;
    --text-secondary: #4d5156;
    
    --bg-main: #f8f9fa;
    --bg-panel: #ffffff;
    --border-color: #dadce0;
    
    --color-green: #34a853;
    --color-yellow: #fbbc04;
    --color-red: #ea4335;
    
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* SERP Specific */
    --serp-title-size: 20px;
    --serp-title-hover: #1a0dab;
    --serp-desc-size: 14px;
    --serp-url-size: 14px;
    --desktop-width: 600px;
    --mobile-width: 375px;
}

.dark-mode {
    --bg-main: #202124;
    --bg-panel: #303134;
    --border-color: #5f6368;
    --text-main: #e8eaed;
    --text-secondary: #9aa0a6;
    --primary-blue: #8ab4f8;
    --url-green: #81c995;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
}
.btn-icon:hover {
    background: rgba(128,128,128,0.1);
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.input-group {
    margin-bottom: 1.5rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tooltip {
    background: #e8eaed;
    color: #5f6368;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: help;
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    margin-bottom: 5px;
    z-index: 10;
}

input[type="text"], textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66,133,244,0.2);
}

.url-input-wrapper {
    display: flex;
    align-items: center;
}

.url-prefix {
    padding: 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.url-input-wrapper input {
    border-radius: 0 6px 6px 0;
}

.metrics {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.px-width {
    margin-left: 0.5rem;
    font-style: italic;
}

.progress-bar-container {
    height: 4px;
    background: #e8eaed;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--color-green);
    transition: width 0.3s, background-color 0.3s;
}

.warning-text {
    font-size: 0.8rem;
    color: var(--color-red);
    margin-top: 0.25rem;
}
.hidden {
    display: none;
}

.btn-copy {
    background: none;
    border: none;
    color: #4285f4;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #3367d6;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--color-red);
    border: 1px solid var(--color-red);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(234, 67, 53, 0.1);
}

/* Score Card */
.score-card {
    background: rgba(66, 133, 244, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.score-header h2 {
    font-size: 1.1rem;
}

.score-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
    color: var(--color-green);
}
.dark-mode .score-circle {
    background: var(--bg-panel);
}

.score-bar-container {
    height: 8px;
    background: #e8eaed;
    border-radius: 4px;
    overflow: hidden;
}

.score-bar {
    height: 100%;
    width: 0%;
    background: var(--color-green);
    transition: width 0.5s ease-out, background-color 0.5s ease-out;
}

.score-label {
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
    color: var(--color-green);
}

/* SERP Preview */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.preview-header h2 {
    font-size: 1.1rem;
}

.device-toggle {
    display: flex;
    background: var(--bg-main);
    border-radius: 20px;
    padding: 2px;
}

.device-btn {
    background: transparent;
    border: none;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 18px;
    cursor: pointer;
    color: var(--text-secondary);
}

.device-btn.active {
    background: var(--bg-panel);
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-weight: 500;
}

.serp-preview {
    background: var(--bg-panel);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    font-family: arial, sans-serif; /* Google SERP font */
    margin-bottom: 2rem;
    transition: width 0.3s;
}

.serp-preview.desktop {
    width: 100%;
    max-width: var(--desktop-width);
}

.serp-preview.mobile {
    width: var(--mobile-width);
    margin: 0 auto 2rem auto;
}

.serp-breadcrumb {
    font-size: var(--serp-url-size);
    color: var(--text-main);
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark-mode .serp-breadcrumb {
    color: #dadce0;
}

.serp-title {
    font-size: var(--serp-title-size);
    color: var(--primary-blue);
    font-weight: 400;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.serp-title:hover {
    text-decoration: underline;
}

.serp-description {
    font-size: var(--serp-desc-size);
    color: var(--text-secondary);
    line-height: 1.58;
    overflow-wrap: break-word;
}
.serp-description b, .serp-title b {
    font-weight: bold;
}

/* Suggestions */
.suggestions-card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.suggestions-list {
    list-style: none;
}

.suggestion-item {
    font-size: 0.9rem;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #f8f9fa;
    border-left: 3px solid #dadce0;
}
.dark-mode .suggestion-item {
    background: var(--bg-main);
}

.suggestion-item.good {
    border-left-color: var(--color-green);
    background: rgba(52, 168, 83, 0.05);
}

.suggestion-item.warning {
    border-left-color: var(--color-yellow);
    background: rgba(251, 188, 4, 0.05);
}

.suggestion-item.bad {
    border-left-color: var(--color-red);
    background: rgba(234, 67, 53, 0.05);
}

/* --- Future AdSense Placeholders --- */
/* These are hidden by default to preserve UX until ads are approved */
/* To activate: remove style="display: none;" from the HTML divs */
.ad-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    margin: 1.5rem auto;
    width: 100%;
}

.ad-leaderboard-top, 
.ad-leaderboard-bottom {
    min-height: 90px;
    max-width: 728px;
}

.ad-sidebar-square {
    min-height: 250px;
    max-width: 300px;
    margin-top: 2rem;
}
