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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px 30px;
}

.validator-form {
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95em;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 14px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1.05em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.results {
    margin-top: 40px;
    animation: fadeIn 0.5s ease;
}

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

.results-header {
    margin-bottom: 25px;
}

.results-header h2 {
    font-size: 1.8em;
    margin-bottom: 12px;
    color: #333;
}

.results-url {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    word-break: break-all;
    font-size: 0.9em;
}

.results-url a {
    color: #667eea;
    text-decoration: none;
}

.results-url a:hover {
    text-decoration: underline;
}

.summary {
    margin-bottom: 30px;
}

.alert {
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-errors {
    background: #fee;
    border: 2px solid #fcc;
}

.stat-warnings {
    background: #fff4e5;
    border: 2px solid #ffe0b2;
}

.stat-number {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-errors .stat-number {
    color: #c62828;
}

.stat-warnings .stat-number {
    color: #f57c00;
}

.stat-label {
    display: block;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #666;
}

.info-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #e3f2fd;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.info-section h3 {
    margin-bottom: 12px;
    color: #1976d2;
    font-size: 1.2em;
}

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

.info-list li {
    padding: 6px 0;
    color: #555;
}

.info-list li:before {
    content: "ℹ ";
    color: #2196f3;
    font-weight: bold;
    margin-right: 8px;
}

.messages-section {
    margin-bottom: 30px;
}

.messages-section h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #333;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    border-radius: 6px;
    padding: 15px;
    border-left: 4px solid;
}

.message-error {
    background: #ffebee;
    border-left-color: #c62828;
}

.message-warning {
    background: #fff8e1;
    border-left-color: #f57c00;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.message-type {
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-error .message-type {
    color: #c62828;
}

.message-warning .message-type {
    color: #f57c00;
}

.message-location {
    font-size: 0.85em;
    color: #666;
    font-family: "Courier New", monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 3px;
}

.message-content {
    color: #333;
    line-height: 1.5;
}

.source-context {
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 12px;
}

.source-header {
    font-size: 0.85em;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-code {
    background: #1e1e1e;
    border-radius: 4px;
    padding: 12px;
    margin: 0;
    overflow-x: auto;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

.code-line {
    display: flex;
    min-height: 1.6em;
}

.code-line.error-line {
    background: rgba(255, 0, 0, 0.15);
}

.line-number {
    display: inline-block;
    min-width: 40px;
    padding-right: 12px;
    text-align: right;
    color: #858585;
    user-select: none;
    flex-shrink: 0;
}

.line-content {
    color: #d4d4d4;
    white-space: pre;
    flex-grow: 1;
}

.error-marker {
    display: block;
    color: #ff5555;
    font-weight: bold;
    pointer-events: none;
}

footer {
    text-align: center;
    padding: 25px;
    background: #f8f9fa;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #e9ecef;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    main {
        padding: 25px 20px;
    }

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

    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
