/* ============================================================
   DnnCNCEnquiry Module Styles
   Sydenhams Branding - Responsive & Accessible
   ============================================================

   PUBLIC-FACING FORM STYLES have been moved to the shared
   component library: /Skin/Css/syd-components.css

   This file now contains ONLY:
   - CNC-specific UI: info banner, help tooltips, checkbox grid,
     file upload, GDPR consent, confirmation inner structure
   - Admin grid / filters / status badges / detail view / settings
   - Accessibility & print media queries
   ============================================================ */


/* ============================================================
   Info Banner (lead times / important notices)
   ============================================================ */

.cnc-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    background: #d5e8f0;
    border: 1px solid var(--syd-primary, #0071b9);
    border-left: 4px solid var(--syd-primary, #0071b9);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--syd-text-body, #424242);
}

.cnc-info-banner-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cnc-info-banner-note {
    color: #666;
    font-size: 13px;
}


/* ============================================================
   Help Tooltips
   ============================================================ */

.cnc-help-icon,
.cnc-help-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--syd-primary, #0071b9);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    flex-shrink: 0;
    position: relative;
    user-select: none;
    line-height: 1;
}

.cnc-help-icon-inline {
    vertical-align: middle;
    margin: 0 2px;
}

.cnc-help-icon:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 113, 185, 0.4);
}

/* Tooltip bubble */
.cnc-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--syd-dark-blue, #2d4c72);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    width: 240px;
    text-align: left;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip arrow */
.cnc-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--syd-dark-blue, #2d4c72);
}

/* Show on hover and focus */
.cnc-help-icon:hover .cnc-tooltip,
.cnc-help-icon:focus .cnc-tooltip,
.cnc-help-icon.cnc-tooltip-active .cnc-tooltip {
    opacity: 1;
    visibility: visible;
}


/* ============================================================
   Checkbox Grid (specification checklist)
   ============================================================ */

.cnc-checkbox-section {
    margin-bottom: 16px;
}

.cnc-checkbox-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--syd-primary, #0071b9);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}

.cnc-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.cnc-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: var(--syd-bg-light, #f4f4f4);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.cnc-checkbox-item:hover {
    background: #d5e8f0;
}

.cnc-required-check {
    border-left: 3px solid var(--syd-primary, #0071b9);
}

.cnc-check-confirmed {
    background: #e8f5e9;
    border-color: #28a745;
}

.cnc-checkbox-item label {
    cursor: pointer;
    font-size: 14px;
    margin: 0;
    flex: 1;
}

.cnc-checkbox {
    accent-color: var(--syd-primary, #0071b9);
}


/* ============================================================
   GDPR Consent Box
   ============================================================ */

.cnc-gdpr-consent {
    background: #fff8e1;
    border-color: #ffc107;
}


/* ============================================================
   CAPTCHA Container
   ============================================================ */

.cnc-captcha-container {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}


/* ============================================================
   Link Style
   ============================================================ */

.cnc-link {
    color: var(--syd-primary, #0071b9);
    text-decoration: underline;
    cursor: pointer;
}


/* ============================================================
   Confirmation Panel — Inner Structure
   (outer wrapper uses .syd-thankyou from shared library)
   ============================================================ */

.cnc-confirmation-ref {
    background: #d5e8f0;
    border: 2px solid var(--syd-primary, #0071b9);
    border-radius: 6px;
    padding: 16px 24px;
    display: inline-block;
    margin: 24px 0;
}

.cnc-ref-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.cnc-ref-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--syd-primary, #0071b9);
    letter-spacing: 1px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}

.cnc-confirmation-summary,
.cnc-confirmation-next {
    text-align: left;
    max-width: 600px;
    margin: 24px auto;
}

.cnc-confirmation-summary h3,
.cnc-confirmation-next h3 {
    color: var(--syd-primary, #0071b9);
    border-bottom: 2px solid #d5e8f0;
    padding-bottom: 8px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}

.cnc-confirmation-overflow {
    margin-top: 24px;
    padding: 16px;
    background: var(--syd-bg-light, #f4f4f4);
    border-radius: 6px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


/* ============================================================
   Admin Module Wrapper
   ============================================================ */

.cnc-admin-module {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    font-size: 15px;
    color: var(--syd-text-body, #424242);
    line-height: 1.5;
}


/* ============================================================
   Admin Filters
   ============================================================ */

.cnc-admin-filters {
    background: var(--syd-bg-light, #f4f4f4);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.cnc-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.cnc-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 150px;
}

.cnc-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.cnc-filter-actions {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}


/* ============================================================
   Admin Grid
   ============================================================ */

.cnc-grid {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}

.cnc-grid th,
.cnc-grid td {
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.cnc-grid-header th {
    background: var(--syd-primary, #0071b9);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cnc-grid-header th a {
    color: #fff;
    text-decoration: none;
}

.cnc-grid-row:hover {
    background: #e8f0f8;
}

.cnc-grid-row-alt {
    background: var(--syd-bg-light, #f4f4f4);
}


/* ============================================================
   Admin Status Badges
   ============================================================ */

.cnc-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cnc-status-new { background: #e3f2fd; color: #1565c0; }
.cnc-status-reviewed { background: #fff3e0; color: #e65100; }
.cnc-status-quoted { background: #f3e5f5; color: #7b1fa2; }
.cnc-status-accepted { background: #e8f5e9; color: #2e7d32; }
.cnc-status-rejected { background: #fce4ec; color: #c62828; }
.cnc-status-closed { background: #eceff1; color: #546e7a; }

/* Scan status */
.cnc-scan-clean { color: #28a745; }
.cnc-scan-quarantined { color: #d32f2f; font-weight: bold; }
.cnc-scan-pending { color: #ffc107; }


/* ============================================================
   Admin Pagination
   ============================================================ */

.cnc-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.cnc-page-info {
    color: #666;
    font-size: 14px;
}


/* ============================================================
   Admin Detail View
   ============================================================ */

.cnc-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--syd-primary, #0071b9);
}

.cnc-detail-header h2 {
    color: var(--syd-text-dark, #363e4c);
    margin: 0 0 8px 0;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}

.cnc-detail-section {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.cnc-detail-section h3 {
    color: var(--syd-primary, #0071b9);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #d5e8f0;
    font-size: 16px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}

.cnc-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.cnc-detail-field {
    display: flex;
    flex-direction: column;
}

.cnc-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cnc-detail-value {
    font-size: 15px;
    color: var(--syd-text-body, #424242);
    margin-top: 2px;
}

.cnc-detail-notes {
    background: var(--syd-bg-light, #f4f4f4);
    padding: 12px 16px;
    border-radius: 6px;
    white-space: pre-wrap;
}

.cnc-checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
}

.cnc-checklist-item {
    padding: 6px 10px;
    font-size: 14px;
    background: var(--syd-bg-light, #f4f4f4);
    border-radius: 4px;
}

.cnc-badge-required {
    font-size: 10px;
    background: var(--syd-primary, #0071b9);
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    margin-left: 4px;
}

.cnc-action-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.cnc-detail-gdpr {
    background: var(--syd-bg-light, #f4f4f4);
    border-color: transparent;
}

.cnc-text-muted {
    color: #666;
    font-size: 13px;
}


/* ============================================================
   Admin Settings
   ============================================================ */

.cnc-settings-module {
    max-width: 600px;
}

.cnc-settings-module fieldset {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.cnc-settings-module legend {
    font-weight: 600;
    color: var(--syd-primary, #0071b9);
    padding: 0 8px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}


/* ============================================================
   Responsive — Module-Specific
   ============================================================ */

@media (max-width: 768px) {
    .cnc-admin-module {
        padding: 12px;
    }

    .cnc-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .cnc-filter-row {
        flex-direction: column;
    }

    .cnc-filter-group {
        flex: 1 1 100%;
    }

    .cnc-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cnc-detail-grid {
        grid-template-columns: 1fr;
    }

    .cnc-grid {
        font-size: 13px;
    }

    .cnc-grid th,
    .cnc-grid td {
        padding: 8px 6px;
    }

    .cnc-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cnc-pagination {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cnc-tooltip {
        left: auto;
        right: -8px;
        transform: none;
    }
    .cnc-tooltip::after {
        left: auto;
        right: 12px;
        transform: none;
    }
}


/* ============================================================
   Accessibility
   ============================================================ */

@media (forced-colors: active) {
    .syd-btn {
        border: 2px solid ButtonText;
    }

    .syd-input:focus {
        outline: 2px solid Highlight;
    }
}

@media (prefers-reduced-motion: reduce) {
    .syd-input,
    .syd-btn,
    .cnc-help-icon,
    .cnc-checkbox-item,
    .syd-upload-area,
    .cnc-tooltip {
        transition: none;
    }
}


/* ============================================================
   Print
   ============================================================ */

@media print {
    .syd-btn-row,
    .cnc-admin-filters,
    .cnc-action-row,
    .cnc-pagination,
    .cnc-captcha-container {
        display: none;
    }
}
