/**
 * Browser Direct Rendering Tests Stylesheet
 * SWCanvas vs HTML5 Canvas Comparison
 */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 20px;
    background: white;
    color: #333;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

header p {
    margin: 0 0 15px 0;
    color: #666;
}

/* Summary Section */
#summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 15px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.summary-count {
    font-weight: bold;
    font-size: 20px;
}

.summary-passed { color: #388e3c; }
.summary-failed { color: #d32f2f; }
.summary-total { color: #1976d2; }

/* Controls */
#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.global-iter-label {
    font-size: 14px;
    color: #666;
    margin-left: 20px;
}

.global-progress {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
}

button {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

button.primary {
    background: #1976d2;
    color: white;
}

button.primary:hover {
    background: #1565c0;
}

button.secondary {
    background: #e0e0e0;
    color: #333;
}

button.secondary:hover {
    background: #d0d0d0;
}

/* Navigation */
#navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-link {
    padding: 6px 12px;
    background: #e3f2fd;
    color: #1976d2;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #bbdefb;
}

.nav-link.passed {
    background: #e8f5e8;
    color: #388e3c;
}

.nav-link.failed {
    background: #ffebee;
    color: #d32f2f;
}

.nav-link.warning {
    background: #fff8e1;
    color: #f9a825;
}

/* Test Container */
#test-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Individual Test Section */
.test-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.test-title {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.test-name {
    font-family: monospace;
    font-size: 12px;
    color: #888;
    margin: 3px 0 0 0;
}

.test-description {
    color: #666;
    font-size: 13px;
    margin: 5px 0 0 0;
}

.run-test-btn {
    padding: 8px 16px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.run-test-btn:hover {
    background: #1565c0;
}

/* Canvas Container */
.canvas-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    flex-wrap: wrap;
}

.canvas-wrapper {
    text-align: center;
}

.canvas-label {
    display: inline-block;
    padding: 6px 16px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

.swcanvas-label {
    background: #e8f5e8;
    color: #388e3c;
}

.html5-label {
    background: #e3f2fd;
    color: #1976d2;
}

.canvas-wrapper canvas {
    border: 2px solid #ddd;
    border-radius: 0 0 4px 4px;
    display: block;
    margin: 0 auto;
}

/* Results Section */
.test-results {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
}

.result-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    min-width: 150px;
    color: #555;
}

.result-value {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
}

/* Direct Rendering Status */
.direct-render-pass {
    color: #388e3c;
    font-weight: 600;
}

.direct-render-fail {
    color: #d32f2f;
    font-weight: 600;
}

.direct-render-expected {
    color: #ff9800;
    font-weight: 600;
}

/* Check Results */
.check-pass {
    color: #388e3c;
}

.check-fail {
    color: #d32f2f;
}

.check-warning {
    color: #f9a825;
}

.check-icon {
    margin-right: 6px;
}

/* Overall Test Result */
.test-result-banner {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
}

.test-pass {
    background: #e8f5e8;
    color: #388e3c;
}

.test-fail {
    background: #ffebee;
    color: #d32f2f;
}

/* Logs */
.test-logs {
    padding: 10px 20px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.test-logs-title {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.log-entry {
    font-family: monospace;
    font-size: 12px;
    color: #555;
    padding: 2px 0;
}

/* Iteration Controls */
.iteration-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.iter-label {
    font-size: 13px;
    color: #666;
    margin-right: 5px;
}

.current-iteration-label {
    font-weight: bold;
    font-size: 13px;
    color: #2c3e50;
    margin-right: 10px;
}

.iter-input {
    width: 60px;
    padding: 4px 8px;
    font-size: 13px;
    font-family: monospace;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 15px;
}

.iter-btn {
    padding: 5px 12px;
    font-size: 12px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.iter-btn:hover {
    background: #d0d0d0;
}

.iter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.iter-btn.stop-btn {
    background: #ffcdd2;
    color: #c62828;
}

.iter-btn.stop-btn:hover {
    background: #ef9a9a;
}

.iter-btn.collect-btn {
    background: #fff3e0;
    color: #e65100;
}

.iter-btn.collect-btn:hover {
    background: #ffe0b2;
}

.iter-progress {
    margin-left: 10px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
}

.iter-progress.iter-pass {
    background: #e8f5e8;
    color: #388e3c;
}

.iter-progress.iter-fail {
    background: #ffebee;
    color: #d32f2f;
}

.iter-row {
    background: #f5f5f5;
    font-size: 13px;
}

.iter-errors {
    padding: 10px;
    background: #fff3e0;
    color: #e65100;
    font-size: 12px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Display/Comparison Canvas */
.display-wrapper {
    position: relative;
}

.display-label-container {
    height: 24px;
    margin-bottom: 3px;
}

.display-label {
    background: #fff3e0;
    color: #e65100;
}

.magnifier-label-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
}

.magnifier-label-container .mag-label {
    flex-basis: 50%;
    text-align: center;
    font-size: 11px;
    background: #e8f5e8;
    color: #388e3c;
    padding: 4px 8px;
}

.flip-btn {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 12px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    border-radius: 4px;
    cursor: pointer;
}

.flip-btn:hover {
    background: #ffe0b2;
}

/* Crosshair cursor for inspection */
canvas[data-renderer="swcanvas"],
canvas[data-renderer="html5"] {
    cursor: crosshair;
}

/* Responsive */
@media (max-width: 800px) {
    .canvas-container {
        flex-direction: column;
        align-items: center;
    }

    #summary {
        flex-direction: column;
        align-items: center;
    }

    .iteration-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Back to Top Link */
.back-to-top {
    display: block;
    text-align: right;
    padding: 10px 20px;
    color: #1976d2;
    text-decoration: none;
    font-size: 13px;
}

.back-to-top:hover {
    text-decoration: underline;
}

/* Transparency Pattern Background */
body.transparency-pattern {
    background-image:
        linear-gradient(45deg, #eee 25%, transparent 25%),
        linear-gradient(-45deg, #eee 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eee 75%),
        linear-gradient(-45deg, transparent 75%, #eee 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Make containers transparent when transparency pattern is enabled */
body.transparency-pattern header,
body.transparency-pattern #navigation,
body.transparency-pattern .test-section {
    background: transparent;
}

/* Transparency checkbox control styling */
.transparency-control {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 20px;
}

.transparency-control label {
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.transparency-control input[type="checkbox"] {
    cursor: pointer;
}

/* Build info styling */
.build-info {
    font-size: 12px;
    color: #888;
    font-family: monospace;
    margin: 5px 0 0 0;
}
