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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1 0 auto;
}

.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 32px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.nav-brand a {
    color: #1e293b;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 16px 16px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #3b82f6;
}

.nav-link.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

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

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e293b;
}

.page-header p {
    font-size: 16px;
    color: #64748b;
}

.feature-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    padding: 32px;
    border: 1px solid #e2e8f0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tool-card-link {
    text-decoration: none;
    color: inherit;
}

.tool-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.tool-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.tool-card h2 {
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 600;
}

.tool-card p {
    color: #64748b;
    font-size: 14px;
}

.input-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #3b82f6;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #334155;
    font-size: 14px;
}

.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.form-group input[type="file"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    font-size: 14px;
    color: #334155;
}

.checkbox-inline input {
    margin-right: 6px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label:hover {
    background: #f1f5f9;
}

.checkbox-label input {
    margin-right: 6px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
}

.result-box {
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
}

.result-box h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1e293b;
}

.result-box h4 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    color: #334155;
}

.result-box ul {
    margin-left: 20px;
    margin-top: 8px;
}

.result-box li {
    margin-bottom: 4px;
}

.error-box {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.success-box {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

pre {
    background: #f8fafc;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    font-size: 13px;
    border: 1px solid #e2e8f0;
}

.result-html {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    max-height: 600px;
    overflow-y: auto;
    background: white;
}

.compare-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.compare-column h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .compare-inputs {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        flex-wrap: wrap;
    }
}

/* Enhanced validation issue display */
.validation-issues {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.validation-issue {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.validation-issue:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.validation-issue.simple {
    padding: 12px 16px;
}

.issue-summary {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.issue-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1.4;
}

.issue-content {
    flex: 1;
}

.issue-location {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
}

.issue-location code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #475569;
}

.issue-requirement {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 8px;
}

.issue-template {
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.template-name {
    font-weight: 500;
    color: #3b82f6;
}

.template-id {
    font-size: 12px;
    color: #64748b;
    font-family: 'Courier New', monospace;
}

.conf-number {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    color: #64748b;
    font-weight: 500;
}

.issue-details {
    margin-top: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.issue-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #3b82f6;
    padding: 4px 0;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.issue-details summary:hover {
    color: #2563eb;
}

.issue-details summary::-webkit-details-marker {
    display: none;
}

.issue-details summary::before {
    content: '▶';
    font-size: 10px;
    transition: transform 0.2s;
    display: inline-block;
}

.issue-details[open] summary::before {
    transform: rotate(90deg);
}

.issue-suggestions {
    margin: 12px 0 0 20px;
    padding: 0;
    list-style: disc;
}

.issue-suggestions li {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 8px;
}

.issue-technical {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
}

.issue-technical > div {
    margin-bottom: 12px;
}

.issue-technical > div:last-child {
    margin-bottom: 0;
}

.issue-technical strong {
    display: block;
    margin-bottom: 4px;
    color: #1e293b;
}

.xpath-code {
    display: block;
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    margin-top: 4px;
}

/* Error box adjustments for new layout */
.error-box .validation-issues {
    background: transparent;
}

.error-box .validation-issue {
    border-color: #fecaca;
}

.success-box .validation-issues {
    background: transparent;
}

/* Footer */
.footer {
    flex-shrink: 0;
    background: white;
    padding: 40px 0 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

/* Warning Banner (dismissible, top of page) */
.warning-banner {
    padding: 16px 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner-container {
    max-width: 1200px;
    margin: 0 auto 0 auto;
    padding: 16px 20px;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.1);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.banner-icon {
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 2px;
}

.banner-icon svg {
    display: block;
}

.banner-content {
    flex: 1;
    font-size: 13px;
    color: #78350f;
    line-height: 1.7;
}

.banner-content strong {
    color: #92400e;
    font-weight: 600;
}

.banner-content a {
    color: #ea580c;
    text-decoration: underline;
}

.banner-content a:hover {
    color: #c2410c;
}

.banner-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #a16207;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.banner-close:hover {
    background: rgba(245, 158, 11, 0.2);
    opacity: 1;
}

.banner-close:active {
    transform: scale(0.95);
}

.banner-close svg {
    display: block;
}

.footer-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.footer-section p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 12px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #3b82f6;
}

.footer-section a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: #2563eb;
}

.footer-license {
    font-size: 13px;
    color: #94a3b8;
}


.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.footer-badges img {
    height: 20px;
}

.footer-bottom {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

/* GitHub icon in navbar */
.nav-link svg {
    vertical-align: middle;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .warning-banner {
        padding: 12px 16px;
    }

    .banner-container {
        gap: 10px;
        padding: 14px 16px;
        border-radius: 8px;
    }

    .banner-content {
        font-size: 12px;
    }

    .banner-close {
        padding: 4px;
    }
}
