/* =============================================
   DentAI Hub — Master Stylesheet
   Includes optimized @media print styles
   ============================================= */

/* --- Root Variables --- */
:root {
    --primary: #1e3a5f;
    --primary-light: #2a5298;
    --accent: #0ea5e9;
    --accent-dark: #0284c7;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 10px 15px rgba(0,0,0,0.1);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 1.5rem;
}

/* --- Layout --- */
main {
    max-width: 960px;
    margin: 0 auto;
}

/* --- Header --- */
.print-header {
    max-width: 960px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 2rem 2.5rem;
    border-radius: var(--radius);
}
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.tagline {
    font-size: 1.05rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    break-inside: avoid;
}
.card h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

/* --- Highlight Box --- */
.highlight-box {
    background: #eef2ff;
    border-left: 4px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1rem 0;
}
.highlight-box strong {
    color: var(--primary-light);
}

/* --- Tables --- */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1rem 0;
}
.comparison-table th {
    background: var(--primary);
    color: #fff;
    padding: 0.7rem 0.75rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
.comparison-table th:first-child { border-radius: 6px 0 0 0; }
.comparison-table th:last-child  { border-radius: 0 6px 0 0; }
.comparison-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.comparison-table tr:hover td {
    background: #f1f5f9;
}

/* --- Badges --- */
.badge-group {
    margin: 0.5rem 0 0.75rem;
}
.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-right: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-fda {
    background: #dbeafe;
    color: #1d4ed8;
}
.badge-hot {
    background: #fef3c7;
    color: #b45309;
}
.badge-enterprise {
    background: #ede9fe;
    color: #7c3aed;
}

/* --- Tool Reviews --- */
.tool-review {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    background: #fafcff;
    transition: box-shadow 0.2s;
}
.tool-review:hover {
    box-shadow: var(--shadow-lg);
}
.tool-review h3 {
    color: var(--primary-light);
    font-size: 1.1rem;
}
.tool-review ul {
    margin: 0.5rem 0 0.5rem 1.5rem;
    line-height: 1.7;
}
.tool-review li {
    margin-bottom: 0.25rem;
}

/* --- CTA Box --- */
.cta-box {
    margin-top: 0.75rem;
}
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    padding: 0.55rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.15s;
}
.btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}
/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-color: #a5b4fc;
}
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.btn-primary {
    background: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-light);
}
.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
}

/* --- Checklist --- */
.checklist label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 6px;
}
.checklist label:hover {
    background: #f1f5f9;
    padding-left: 0.5rem;
}
.checklist input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

/* --- Star Ratings --- */
.star5 { color: #16a34a; font-weight: 700; }
.star4 { color: #2563eb; font-weight: 600; }
.star3 { color: #d97706; font-weight: 600; }
.star2 { color: #dc2626; font-weight: 600; }

/* --- Footer --- */
footer {
    max-width: 960px;
    margin: 2rem auto 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.disclaimer {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* =============================================
   @media print — Optimized for PDF export
   ============================================= */
@media print {
    /* Reset background & shadow for print */
    * { background: transparent !important; box-shadow: none !important; }
    
    body {
        color: #000;
        font-size: 11pt;
        line-height: 1.5;
        padding: 0.2in;
    }

    .print-header {
        background: #1e3a5f !important;
        color: #fff !important;
        padding: 0.4in 0.5in;
        margin-bottom: 0.3in;
        border-radius: 4px;
        page-break-after: avoid;
    }
    .print-header .logo { font-size: 20pt; }
    .print-header .tagline { font-size: 11pt; }

    main { max-width: 100%; }
    .card {
        border: 1px solid #ccc;
        padding: 0.25in 0.3in;
        margin-bottom: 0.2in;
        page-break-inside: avoid;
    }
    .card h2 {
        font-size: 14pt;
        color: #1e3a5f;
        border-bottom: 1px solid #999;
    }

    .comparison-table { font-size: 9pt; }
    .comparison-table th {
        background: #1e3a5f !important;
        color: #fff !important;
        padding: 4pt 6pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .comparison-table td {
        padding: 3pt 6pt;
        border-bottom: 1px solid #ddd;
    }
    .comparison-table tr:hover td { background: transparent !important; }

    .badge {
        border: 1px solid #999;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .badge-fda { background: #dbeafe !important; color: #1d4ed8 !important; }
    .badge-hot { background: #fef3c7 !important; color: #b45309 !important; }
    .badge-enterprise { background: #ede9fe !important; color: #7c3aed !important; }

    .tool-review {
        border: 1px solid #ccc;
        padding: 0.15in 0.2in;
        margin: 0.15in 0;
        page-break-inside: avoid;
    }
    .tool-review h3 { color: #1e3a5f; font-size: 12pt; }

    .highlight-box {
        border-left: 4px solid #1e3a5f;
        padding: 0.1in 0.15in;
    }

    .btn {
        border: 1px solid #000;
        color: #000 !important;
        text-decoration: underline;
        padding: 0;
        background: transparent !important;
    }
    .btn:hover { transform: none; }

    .cta-section {
        border-color: #999;
        padding: 0.2in;
        page-break-inside: avoid;
    }
    .btn-primary, .btn-secondary {
        border: 1px solid #000;
        color: #000 !important;
        background: transparent !important;
    }

    .checklist input[type="checkbox"] {
        border: 1px solid #000;
        -webkit-appearance: none;
        appearance: none;
        width: 10pt;
        height: 10pt;
    }

    .star5 { color: #16a34a !important; }
    .star4 { color: #2563eb !important; }
    .star3 { color: #d97706 !important; }

    footer {
        font-size: 8pt;
        color: #666;
        margin-top: 0.3in;
        page-break-before: avoid;
    }

    /* Prevent links from showing URL in print */
    a[href]::after { content: none !important; }

    /* Section page breaks for long printouts */
    section.card:not(:first-of-type) {
        page-break-before: auto;
    }
}

/* --- Mobile Responsive --- */
@media (max-width: 720px) {
    body { padding: 0.75rem; }
    .card { padding: 1.25rem; }
    .print-header { padding: 1.5rem; }
    .comparison-table { font-size: 0.8rem; }
    .comparison-table th, .comparison-table td {
        padding: 0.45rem 0.5rem;
    }
    .cta-buttons { flex-direction: column; align-items: center; }
    .btn { width: 100%; text-align: center; }
}
