:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-gray: #ecf0f1;
    --medium-gray: #bdc3c7;
    --dark-gray: #7f8c8d;
    --text-color: #34495e;
    --bg-color: #f4f7f9;
    --card-bg: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2.5em;
    margin-bottom: 0.2em;
}

header p {
    font-size: 1.1em;
    color: var(--dark-gray);
}

.card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
}

.crawl-form .form-group {
    margin-bottom: 20px;
}

.crawl-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.crawl-form input[type="text"],
.crawl-form input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.crawl-form input[type="text"]:focus,
.crawl-form input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

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

.cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.cta-button:hover {
    background-color: #2980b9;
}
.cta-button:active {
    transform: translateY(1px);
}

.cta-button:disabled {
    background-color: var(--medium-gray);
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

#progressSection h2 {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    margin-top: 0;
    color: var(--primary-color);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0,0,0,0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#progressBarContainer {
    width: 100%;
    background-color: var(--light-gray);
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

#progressBar {
    width: 0%;
    height: 22px;
    background-color: var(--secondary-color);
    text-align: center;
    line-height: 22px;
    color: white;
    font-weight: 500;
    border-radius: 4px;
    transition: width 0.4s ease-out, background-color 0.4s ease;
}

#progressBar.error {
    background-color: var(--danger-color);
}

.status-text {
    font-weight: 500;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.log-container {
    margin-top: 20px;
}
.log-container h4 {
    margin-bottom: 8px;
    font-weight: 500;
}
#logMessages {
    list-style-type: none;
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.9em;
    background-color: #f8f9fa;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
}

#logMessages li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    word-break: break-all;
}
#logMessages li:last-child {
    border-bottom: none;
}
#logMessages li.error {
    color: var(--danger-color);
    font-weight: bold;
}
#logMessages li.warning {
    color: var(--warning-color);
}


#resultsSection h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 2em;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
}
.summary-grid > div {
    background-color: var(--light-gray);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}
.summary-title {
    display: block;
    font-size: 0.9em;
    color: var(--dark-gray);
    margin-bottom: 5px;
}
.summary-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
}
.summary-value.danger { color: var(--danger-color); }
.summary-value.warning { color: var(--warning-color); }


.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--light-gray);
}
.tab-button {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1em;
    font-weight: 500;
    color: var(--dark-gray);
    border-bottom: 3px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}
.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.tab-button:hover {
    color: var(--primary-color);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
.tab-content h3 {
    margin-top: 0;
    font-size: 1.4em;
    color: var(--text-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 15px;
}

.filter-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    box-sizing: border-box;
}

.results-list, .insights-list {
    list-style-type: none;
    padding-left: 0;
    max-height: 400px;
    overflow-y: auto;
}
.results-list li, .insights-list li {
    padding: 10px;
    border-bottom: 1px solid var(--light-gray);
    font-size: 0.95em;
}
.results-list li:last-child, .insights-list li:last-child {
    border-bottom: none;
}
.results-list li a {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
}
.results-list li a:hover {
    text-decoration: underline;
}

.insights-list .insight-severity-error { border-left: 4px solid var(--danger-color); }
.insights-list .insight-severity-warning { border-left: 4px solid var(--warning-color); }
.insights-list .insight-severity-info { border-left: 4px solid var(--secondary-color); }

.insights-list .insight-message { display: block; }
.insights-list .insight-page, .insights-list .insight-suggestion { 
    display: block;
    font-size: 0.9em;
    color: var(--dark-gray);
    margin-top: 4px;
}
.insights-list .insight-suggestion { font-style: italic; }
.insights-list strong { color: var(--text-color); }

hr {
    border: none;
    border-top: 1px solid var(--light-gray);
    margin: 20px 0;
}