/* Styles specific to the SEO Content Analyzer Tool */

.seo-analyzer-container {
    max-width: 1200px; /* Allow wide layout */
    margin: 1rem auto;
    padding: 1.5rem;
    /* background-color: var(--bg-color); */
}

.seo-analyzer-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    color: var(--text-color);
}

.main-layout {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.input-and-controls-area {
    flex: 1; /* Takes ~40% */
    min-width: 350px;
    background-color: var(--preview-bg);
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.results-and-preview-area {
    flex: 1.5; /* Takes ~60% */
    min-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.results-and-preview-area.hidden { display: none; }

.input-and-controls-area h3,
.key-insights-area h3,
.content-preview-area h3 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: 1.15rem;
    color: var(--label-text);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.control-group {
    margin-bottom: 1rem;
}
.control-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--label-text);
    font-size: 0.9rem;
}
.control-group input[type="text"],
.control-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.control-group textarea {
    min-height: 300px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    resize: vertical;
}
.control-group input:focus,
.control-group textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}
body.dark-mode .control-group input:focus,
body.dark-mode .control-group textarea:focus {
    box-shadow: 0 0 0 2px rgba(102, 191, 255, 0.25);
}

.control-button.analyze {
    display: block;
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    background-color: var(--accent-color);
    color: var(--bg-color-light);
    margin-top: 1.5rem;
    text-align: center;
}
body.dark-mode .control-button.analyze { color: var(--bg-color-dark); }
.control-button.analyze:hover { opacity: 0.9; }

#analysis-error { min-height: 1.2em; margin-top: 0.5rem; }

/* Key Insights Area */
.key-insights-area {
    background-color: var(--preview-bg);
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.insight-item {
    background-color: var(--bg-color);
    padding: 0.8rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color); /* Accent border */
    font-size: 0.9rem;
}
body.dark-mode .insight-item { border-left-color: var(--accent-color-dark); }

.insight-label {
    display: block;
    font-weight: 500;
    color: var(--label-text);
    margin-bottom: 0.3rem;
}
.insight-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
}
.insight-value.status-yes { color: #28a745; } /* Green */
.insight-value.status-no { color: #dc3545; } /* Red */
.insight-value.status-ok { color: #28a745; }
.insight-value.status-warning { color: #ffc107; } /* Yellow/Orange */

body.dark-mode .insight-value.status-yes { color: #34c759; }
body.dark-mode .insight-value.status-no { color: #ff453a; }
body.dark-mode .insight-value.status-ok { color: #34c759; }
body.dark-mode .insight-value.status-warning { color: #ffd60a; }

.insight-item small.recommendation {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.2rem;
}

/* Content Preview Area */
.content-preview-area {
     background-color: var(--preview-bg);
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
#content-preview {
    background-color: var(--bg-color);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    max-height: 60vh; /* Limit preview height */
    overflow-y: auto;
    line-height: 1.6;
}
/* Basic styling for rendered content - add more as needed */
#content-preview h1, #content-preview h2, #content-preview h3,
#content-preview h4, #content-preview h5, #content-preview h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text-color);
    line-height: 1.3;
}
#content-preview h1 { font-size: 1.8em; }
#content-preview h2 { font-size: 1.5em; }
#content-preview h3 { font-size: 1.3em; }
#content-preview h4 { font-size: 1.1em; }
#content-preview p { margin-bottom: 1em; }
#content-preview a { color: var(--accent-color); }
body.dark-mode #content-preview a { color: var(--accent-color-dark); }
#content-preview ul, #content-preview ol { margin-left: 1.5em; margin-bottom: 1em; }
#content-preview li { margin-bottom: 0.3em; }
#content-preview code {
    background-color: rgba(0,0,0,0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}
body.dark-mode #content-preview code { background-color: rgba(255,255,255,0.1); }
#content-preview blockquote {
    border-left: 3px solid var(--border-color);
    margin-left: 0;
    padding-left: 1em;
    color: var(--label-text);
    font-style: italic;
}
#content-preview img { max-width: 100%; height: auto; margin: 1em 0; }


/* Keyword Highlighting */
#content-preview mark.kw-focus {
    background-color: rgba(255, 255, 0, 0.6); /* Yellow highlight */
    color: inherit;
    padding: 0.1em 0;
    border-radius: 2px;
}
#content-preview mark.kw-related {
    background-color: rgba(173, 216, 230, 0.7); /* Light blue highlight */
    color: inherit;
    padding: 0.1em 0;
     border-radius: 2px;
}

body.dark-mode #content-preview mark.kw-focus { background-color: rgba(255, 255, 100, 0.5); }
body.dark-mode #content-preview mark.kw-related { background-color: rgba(100, 150, 200, 0.5); }

.hidden { display: none; }

/* Responsive */
@media (max-width: 900px) {
    .main-layout { flex-direction: column; }
    .input-and-controls-area, .results-and-preview-area {
        flex: none; /* Reset flex */
        width: 100%; /* Take full width */
        max-width: 100%;
    }
}
@media (max-width: 600px) {
     .seo-analyzer-container { padding: 1rem; }
     .input-and-controls-area, .results-and-preview-area, .key-insights-area, .content-preview-area { padding: 1rem; }
     .insights-grid { grid-template-columns: 1fr; } /* Stack insights */
}