/* ============================================================
   PRINT TEST PAGES — Shared Print-Optimized Styles
   These styles ensure test pages print accurately on any printer
   ============================================================ */

/* ---------- Screen View Layout ---------- */
:root {
    --bg-primary: #060b18;
    --bg-secondary: #0c1224;
    --bg-card: rgba(15, 23, 50, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f0f2f8;
    --text-secondary: #8892b0;
    --accent-cyan: #00d4ff;
    --accent-purple: #a855f7;
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #a855f7 50%, #ec4899 100%);
    --gradient-cta: linear-gradient(135deg, #00d4ff 0%, #3b82f6 100%);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---------- Page Wrapper ---------- */
.test-page-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* ---------- Header Bar ---------- */
.test-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(6, 11, 24, 0.95);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.test-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.test-header__logo .logo-accent {
    color: var(--accent-cyan);
}

.test-header__actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.btn-print--primary {
    background: var(--gradient-cta);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-print--primary:hover {
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.btn-print--secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-glass-hover);
}

.btn-print--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-cyan);
}

/* ---------- Page Title Section ---------- */
.test-page-info {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.test-page-info h1 {
    font-size: clamp(1.8rem, 1.5rem + 1.5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.test-page-info .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.test-page-info p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---------- Instructions Bar ---------- */
.print-instructions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 2rem;
    margin: 0 auto 2rem;
    max-width: 700px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.print-instructions span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.print-instructions kbd {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.82rem;
    font-family: var(--font-family);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--accent-cyan);
}

/* ---------- The Print Zone ---------- */
.print-zone {
    background: #ffffff;
    color: #000000;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 3rem;
    padding: 15mm;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    position: relative;
}

/* Test Page Content Styles */
.print-zone h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
}

.print-zone h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 1rem 0 0.4rem;
    color: #333;
}

.print-zone p {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.print-zone .test-page-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    border: none;
    padding: 0;
    color: #000;
}

.print-zone .test-page-subtitle {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.print-zone .test-page-url {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    margin-bottom: 1rem;
}

/* Color Blocks Grid */
.color-grid {
    display: grid;
    gap: 4px;
    margin-bottom: 1rem;
}

.color-grid--4col {
    grid-template-columns: repeat(4, 1fr);
}

.color-grid--8col {
    grid-template-columns: repeat(8, 1fr);
}

.color-grid--6col {
    grid-template-columns: repeat(6, 1fr);
}

.color-swatch {
    aspect-ratio: 1;
    border: 0.5px solid #ccc;
}

/* ---------- Footer for standalone pages ---------- */
.test-footer {
    background: rgba(6, 11, 24, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.25rem 2rem;
    color: #d9e2f4;
    text-align: center;
    margin-top: 2rem;
}

.test-footer__container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.test-footer a {
    color: #00d4ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.test-footer a:hover {
    color: #a855f7;
}


.color-swatch--wide {
    aspect-ratio: auto;
    height: 30px;
}

.color-swatch--tall {
    aspect-ratio: auto;
    height: 50px;
}

/* Gradient Bars */
.gradient-bar {
    height: 25px;
    margin-bottom: 8px;
    border: 0.5px solid #ccc;
}

.gradient-bar--thin {
    height: 15px;
}

.gradient-bar--thick {
    height: 40px;
}

/* Text Samples */
.text-sample {
    margin-bottom: 0.75rem;
    padding: 8px;
    border: 0.5px solid #eee;
}

.text-sample p {
    margin-bottom: 4px;
}

/* Registration Marks */
.registration-marks {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    margin-top: 1rem;
    border-top: 1px solid #ddd;
}

.reg-mark {
    width: 16px;
    height: 16px;
    position: relative;
}

.reg-mark::before,
.reg-mark::after {
    content: '';
    position: absolute;
    background: #000;
}

.reg-mark::before {
    width: 16px;
    height: 1px;
    top: 50%;
    left: 0;
}

.reg-mark::after {
    width: 1px;
    height: 16px;
    left: 50%;
    top: 0;
}

/* Grayscale pattern */
.grayscale-strip {
    display: flex;
    margin-bottom: 8px;
}

.grayscale-strip div {
    flex: 1;
    height: 30px;
}

/* Alignment Grid */
.alignment-grid {
    display: grid;
    border: 1px solid #000;
    margin-bottom: 1rem;
}

.alignment-grid-cell {
    border: 0.5px solid #000;
    aspect-ratio: 1;
}

/* Footer on test page */
.print-zone-footer {
    margin-top: 1.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ccc;
    font-size: 0.65rem;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---------- Related Pages Section ---------- */
.related-pages {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.related-pages h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.related-card {
    display: block;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glass-hover);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
}

.related-card__icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.related-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.related-card__desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ---------- Back to Home Link ---------- */
.back-home {
    text-align: center;
    padding: 2rem;
}

.back-home a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.back-home a:hover {
    color: var(--accent-purple);
}

/* ============================
   PRINT MEDIA STYLES
   Only the .print-zone content prints
   ============================ */
@media print {

    /* Hide everything except print zone */
    body {
        background: #fff !important;
        margin: 0;
        padding: 0;
    }

    .test-header,
    .test-page-info,
    .print-instructions,
    .related-pages,
    .back-home {
        display: none !important;
    }

    .test-page-wrapper {
        padding: 0;
        max-width: none;
    }

    .print-zone {
        width: 100%;
        min-height: auto;
        margin: 0;
        padding: 10mm;
        box-shadow: none;
        border-radius: 0;
    }

    /* Ensure colors print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    @page {
        size: A4;
        margin: 5mm;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .print-zone {
        width: 100%;
        min-height: auto;
        padding: 10mm;
    }

    .test-header {
        padding: 0.75rem 1rem;
    }

    .print-instructions {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .test-header__actions .btn-print span.btn-label {
        display: none;
    }
}