/* main.css - Global Variables, Layout Structure, and Print Styles */

:root {
    --tp-bg-dark: #0a0c10;
    --tp-bg-panel: #161b22;
    --tp-bg-accent: #21262d;
    --tp-text-main: #c9d1d9;
    --tp-text-muted: #8b949e;
    --tp-primary: #58a6ff; 
    --tp-success: #238636;
    --tp-danger: #da3633;
    --tp-warning: #d29922;
    --tp-border: #30363d;

    /* Batch 31 shared visual language tokens */
    --tp-surface-soft: rgba(22, 27, 34, 0.82);
    --tp-surface-strong: rgba(33, 38, 45, 0.92);
    --tp-border-strong: #46515f;
    --tp-info: #58a6ff;
    --tp-success-soft: rgba(46, 160, 67, 0.12);
    --tp-danger-soft: rgba(248, 81, 73, 0.12);
    --tp-warning-soft: rgba(210, 153, 34, 0.13);
    --tp-info-soft: rgba(88, 166, 255, 0.12);
    --tp-radius-sm: 8px;
    --tp-radius-md: 12px;
    --tp-radius-lg: 16px;
    --tp-shadow-card: 0 14px 34px rgba(0, 0, 0, 0.28);
    --tp-shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.20);
    --tp-focus-ring: 0 0 0 3px rgba(88, 166, 255, 0.22);

    /* Print Branding (AODA Compliant) */
    --hh-dark-grey: #212121;
    --hh-red: #D32F2F;
    --hh-purple: #7B1FA2;
    --hh-white: #ffffff;
}

/* Custom Scrollbars */
#tactics-pro-app ::-webkit-scrollbar { width: 6px; height: 6px; }
#tactics-pro-app ::-webkit-scrollbar-track { background: transparent; }
#tactics-pro-app ::-webkit-scrollbar-thumb { background: var(--tp-border); border-radius: 3px; }
#tactics-pro-app ::-webkit-scrollbar-thumb:hover { background: var(--tp-text-muted); }

/* Reset */
#tactics-pro-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--tp-bg-dark);
    color: var(--tp-text-main);
    height: calc(100vh - 32px); 
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

#tactics-pro-app * { box-sizing: inherit; margin: 0; padding: 0; }

/* Main Navigation */
#tactics-pro-app .main-nav {
    height: 64px;
    background-color: var(--tp-bg-panel);
    border-bottom: 1px solid var(--tp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
}

#tactics-pro-app .nav-logo { font-weight: 800; font-size: 1.2rem; letter-spacing: 1px; color: white; }
#tactics-pro-app .nav-logo span { color: var(--tp-primary); }

#tactics-pro-app .nav-links { display: flex; gap: 10px; height: 100%; }
#tactics-pro-app .nav-btn {
    background: transparent; border: none; border-bottom: 3px solid transparent; border-radius: 0;
    color: var(--tp-text-muted); font-weight: 600; font-size: 0.9rem; padding: 0 15px; height: 64px; 
    cursor: pointer; transition: all 0.2s;
}
#tactics-pro-app .nav-btn:hover { color: white; }
#tactics-pro-app .nav-btn.active { color: var(--tp-primary); border-bottom-color: var(--tp-primary); }

#tactics-pro-app .nav-actions { display: flex; align-items: center; gap: 12px; }
#tactics-pro-app .history-controls { display: flex; gap: 5px; margin-right: 10px; padding-right: 15px; border-right: 1px solid var(--tp-border); }

/* Layouts */
#tactics-pro-app .page-content { flex: 1; overflow-y: auto; overflow-x: hidden; }
#tactics-pro-app .playmaker-layout { display: flex; height: 100%; overflow: hidden; }
#tactics-pro-app .field-container { flex: 1; display: flex; flex-direction: column; background: #0d1117; position: relative; overflow: hidden; }
#tactics-pro-app .canvas-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; }
#tactics-pro-app canvas { box-shadow: 0 0 60px rgba(0,0,0,0.9); border-radius: 4px; cursor: crosshair; touch-action: none; }

/* --- PRINT STYLES (BULLETPROOF PDF GENERATOR) --- */
.print-only { display: none; }

@media print {
    /* 1. Hide EVERYTHING by default */
    body * {
        visibility: hidden;
    }

    /* 2. Hide the WordPress Admin Bar and Theme Headers */
    #wpadminbar, header, footer, sidebar, .no-print {
        display: none !important;
    }

    /* 3. Force the page to Landscape and remove margins */
    @page {
        size: landscape;
        margin: 0.5cm; 
    }

    /* 4. Make the Print Area visible and absolute position it to the top left */
    #printArea, #printArea * {
        visibility: visible;
    }
    
    #printArea {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white;
        color: var(--hh-dark-grey);
    }

    /* Header */
    .print-report-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: white;
        padding: 10px 20px;
        border-bottom: 2px solid var(--hh-red);
        margin-bottom: 10px;
    }

    .print-brand { display: flex; align-items: center; gap: 15px; }
    .print-brand img { height: 45px; width: auto; }
    
    #displayPrintTagline { font-size: 1.1rem; font-weight: 800; text-transform: uppercase; color: var(--hh-dark-grey); line-height: 1.1; margin: 0; }
    .print-slogan { font-size: 0.8rem; font-style: italic; color: var(--hh-purple); margin: 0; }
    #displayPrintWebsite { font-size: 0.7rem; color: #666; margin: 0; }
    
    #printTitle { font-size: 1.4rem; text-transform: uppercase; font-weight: 900; color: var(--hh-dark-grey); border-left: 4px solid var(--hh-dark-grey); padding-left: 15px; margin: 0; }

    /* Grid */
    .print-grid { display: block; width: 100%; }

    .print-step {
        /* Force each step to be exactly one page height */
        height: 90vh; 
        page-break-after: always;
        page-break-inside: avoid;
        display: flex;
        flex-direction: column; 
        border: 1px solid #ccc;
        margin-bottom: 20px;
        background: #fff;
    }

    .print-step-header {
        flex-shrink: 0; 
        background: #f8f8f8;
        padding: 8px 15px;
        border-bottom: 1px solid #ccc;
    }
    .print-step-header h3 { font-size: 1.1rem; margin: 0; color: var(--hh-dark-grey); font-weight: 700; }

    .print-img-wrapper {
        flex-grow: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: #fff;
        padding: 10px;
    }

    .print-img-wrapper img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain; 
    }

    .print-step-notes {
        flex-shrink: 0; 
        padding: 15px;
        background: #fff;
        border-top: 1px solid #ccc;
        font-size: 10pt;
        overflow: hidden;
        max-height: 20vh; 
    }
    
    .print-note-general { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #ccc; }
    .print-note-label { font-weight: 800; color: var(--hh-red); text-transform: uppercase; font-size: 0.75rem; display: block; margin-bottom: 3px; }
}