/**
 * Classica Research Pages - Branded Styles
 * Using Classica brand palette
 */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Instrument+Sans:wght@400;500;600;700&family=Schibsted+Grotesk:wght@400;500;600;700&display=swap');

:root {
    /* Classica Brand Colors */
    --body-copy: #2B261C;
    --light-primary: #FBF9F7;
    --dark-primary: #2B261C;
    --cta-highlight: #F9A01B;
    --mid-primary: #6F5C44;
    --light-secondary: #C6B5A1;
    
    /* Semantic mappings */
    --bg: var(--light-primary);
    --bg-alt: #F5F2ED;
    --card: #FFFFFF;
    --card-alt: #FAF8F5;
    --text: var(--body-copy);
    --text-muted: #7A7265;
    --accent: var(--cta-highlight);
    --accent-hover: #E8920F;
    --success: #2D8A4E;
    --warning: #C97A1B;
    --danger: #B94A3D;
    --border: rgba(43, 38, 28, 0.1);
    --border-dark: rgba(43, 38, 28, 0.2);
}

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

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 2rem;
}

h1, h2, h3 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
}

.container { 
    max-width: 1400px; 
    margin: 0 auto; 
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark-primary);
}

header h1 span { 
    color: var(--cta-highlight); 
}

.timestamp {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.nav-links { 
    display: flex; 
    gap: 1rem; 
}

.nav-links a { 
    color: var(--mid-primary); 
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover { 
    color: var(--cta-highlight);
    background: rgba(249, 160, 27, 0.1);
}

/* Grid Layouts */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 1.5rem; 
}

.grid-3 { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 1.5rem; 
}

.grid-4 { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 1rem; 
}

/* Cards */
.card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(43, 38, 28, 0.04);
}

.card.wide {
    grid-column: span 2;
}

.card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--mid-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-primary);
    margin-bottom: 0.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    margin-bottom: 0;
}

/* Section Titles */
.section-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    color: var(--dark-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--cta-highlight);
}

/* Stats */
.stat-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(45, 138, 78, 0.08), rgba(45, 138, 78, 0.02));
    border-color: rgba(45, 138, 78, 0.2);
}

.stat-card.warning {
    background: linear-gradient(135deg, rgba(201, 122, 27, 0.08), rgba(201, 122, 27, 0.02));
    border-color: rgba(201, 122, 27, 0.2);
}

.stat-card.danger {
    background: linear-gradient(135deg, rgba(185, 74, 61, 0.08), rgba(185, 74, 61, 0.02));
    border-color: rgba(185, 74, 61, 0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: var(--dark-primary);
}

.stat-value.green { color: var(--success); }
.stat-value.yellow { color: var(--warning); }
.stat-value.red { color: var(--danger); }

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-change {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Icons */
.icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.icon.gold { 
    background: rgba(249, 160, 27, 0.15); 
    color: var(--cta-highlight); 
}

.icon.green { 
    background: rgba(45, 138, 78, 0.15); 
    color: var(--success); 
}

.icon.blue { 
    background: rgba(111, 92, 68, 0.15); 
    color: var(--mid-primary); 
}

.icon.orange { 
    background: rgba(201, 122, 27, 0.15); 
    color: var(--warning); 
}

/* Tables */
table, .pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td,
.pricing-table th,
.pricing-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th,
.pricing-table th {
    background: var(--bg-alt);
    color: var(--mid-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover,
.pricing-table tr:hover {
    background: var(--card-alt);
}

.pricing-table a,
table a {
    color: var(--mid-primary);
    text-decoration: none;
    font-weight: 500;
}

.pricing-table a:hover,
table a:hover { 
    color: var(--cta-highlight);
    text-decoration: underline; 
}

.price {
    font-weight: 700;
    color: var(--success);
}

.price-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag.course { 
    background: rgba(111, 92, 68, 0.15); 
    color: var(--mid-primary); 
}

.tag.k12 { 
    background: rgba(45, 138, 78, 0.15); 
    color: var(--success); 
}

.tag.enterprise { 
    background: rgba(201, 122, 27, 0.15); 
    color: var(--warning); 
}

.tag.community { 
    background: rgba(249, 160, 27, 0.15); 
    color: var(--cta-highlight); 
}

.tag.association {
    background: rgba(111, 92, 68, 0.15);
    color: var(--mid-primary);
}

.tag.competitor {
    background: rgba(185, 74, 61, 0.1);
    color: var(--danger);
}

.tag.resource {
    background: rgba(45, 138, 78, 0.1);
    color: var(--success);
}

.tag.lms {
    background: rgba(249, 160, 27, 0.15);
    color: var(--cta-highlight);
}

/* Feature Lists */
.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
}

.feature-list li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}

/* Feature Matrix */
.feature-matrix {
    font-size: 0.85rem;
}

.feature-matrix td {
    text-align: center;
    padding: 0.5rem;
}

.feature-matrix td:first-child {
    text-align: left;
}

.check { color: var(--success); }
.x { color: var(--light-secondary); }

/* Insight Boxes */
.insight-box {
    background: rgba(249, 160, 27, 0.08);
    border: 1px solid rgba(249, 160, 27, 0.25);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.insight-box h4 {
    color: var(--cta-highlight);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.insight-box.success {
    background: rgba(45, 138, 78, 0.08);
    border-color: rgba(45, 138, 78, 0.25);
}

.insight-box.success h4,
.insight-box.success strong:first-child {
    color: var(--success);
}

.insight-box.warning {
    background: rgba(201, 122, 27, 0.08);
    border-color: rgba(201, 122, 27, 0.25);
}

.insight-box.warning h4,
.insight-box.warning strong:first-child {
    color: var(--warning);
}

/* Compare Cards */
.compare-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(43, 38, 28, 0.04);
}

.compare-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--dark-primary);
}

.compare-card .subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.compare-card .price-range {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.model-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-alt);
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 1rem;
    color: var(--mid-primary);
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    height: 300px;
    margin: 1rem 0;
}

/* Breakdown Items */
.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.breakdown-item:last-child { 
    border: none; 
}

.breakdown-item .label { 
    color: var(--text-muted); 
}

.breakdown-item .value { 
    font-weight: 600;
    color: var(--dark-primary);
}

/* Form Elements */
label {
    display: block;
    font-size: 0.85rem;
    color: var(--mid-primary);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

input[type="number"], 
input[type="text"], 
select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: inherit;
}

input:focus, 
select:focus {
    outline: none;
    border-color: var(--cta-highlight);
    box-shadow: 0 0 0 3px rgba(249, 160, 27, 0.15);
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.input-group input {
    border-radius: 8px 0 0 8px;
    margin-bottom: 0;
}

.input-group span {
    background: var(--bg-alt);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-dark);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* LMS Cards */
.lms-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}

.lms-info h4 { 
    margin-bottom: 0.25rem; 
    color: var(--dark-primary);
}

.lms-info p { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
}

.lms-info a { 
    color: var(--mid-primary); 
    font-size: 0.8rem; 
    font-weight: 500;
}

.lms-info a:hover {
    color: var(--cta-highlight);
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
    text-align: center;
    color: var(--text-muted);
}

footer a {
    color: var(--mid-primary);
}

footer a:hover {
    color: var(--cta-highlight);
}

/* Logo Header */
.logo-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-header img {
    height: 36px;
    width: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .card.wide { grid-column: span 1; }
}

@media (max-width: 768px) {
    body { padding: 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .pricing-table { font-size: 0.8rem; }
    .pricing-table th, .pricing-table td { padding: 0.5rem; }
    h1 { font-size: 1.8rem; }
}

/* ── Research Page Specific ── */
.links-table { width: 100%; border-collapse: collapse; }
.links-table th, .links-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.links-table th { color: var(--mid-primary); font-size: 0.8rem; text-transform: uppercase; background: var(--bg-alt); }
.links-table a { color: var(--mid-primary); text-decoration: none; font-weight: 500; }
.links-table a:hover { color: var(--cta-highlight); text-decoration: underline; }
.wide { grid-column: span 2; }
.tall { grid-row: span 2; }

/* Agent Cards */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.agent-card { background: var(--card); border-radius: 12px; padding: 1.25rem; border: 1px solid var(--border); transition: transform 0.2s, border-color 0.2s; }
.agent-card:hover { transform: translateY(-2px); border-color: var(--cta-highlight); }
.agent-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.agent-avatar { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; background: var(--bg-alt); }
.agent-name { font-size: 1.1rem; font-weight: 600; color: var(--dark-primary); }
.agent-role { font-size: 0.8rem; color: var(--cta-highlight); }
.agent-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.agent-skills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.skill-tag { font-size: 0.7rem; padding: 0.15rem 0.5rem; background: var(--bg-alt); border-radius: 4px; color: var(--text-muted); }

/* ── Sidebar Layout ── */
.research-layout { display: flex; min-height: 100vh; }
.research-sidebar {
    width: 260px; position: fixed; top: 0; left: 0; height: 100vh;
    overflow-y: auto; background: #fff; border-right: 1px solid var(--border);
    padding: 2rem 1.25rem; z-index: 100;
}
.research-main { margin-left: 260px; flex: 1; padding: 2rem; max-width: 100%; }
.sidebar-brand { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2rem; text-decoration: none; }
.sidebar-brand img { height: 28px; width: auto; }
.sidebar-brand span { font-family: 'Instrument Serif', serif; font-size: 1.1rem; color: var(--dark-primary); }
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin-bottom: 0.15rem; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.75rem;
    border-radius: 8px; text-decoration: none; color: var(--mid-primary);
    font-family: 'Schibsted Grotesk', sans-serif; font-size: 0.82rem; font-weight: 500; transition: all 0.15s;
}
.sidebar-nav a:hover { background: var(--bg-alt); color: var(--dark-primary); }
.sidebar-nav a.active { background: rgba(249, 160, 27, 0.12); color: #F9A01B; font-weight: 600; }
.sidebar-nav a i { font-size: 1rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.sidebar-divider { height: 1px; background: var(--border); margin: 1rem 0; }
.sidebar-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mid-primary); padding: 0.5rem 0.75rem 0.25rem; font-weight: 600; }

.research-sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--dark-primary);
}

@media (max-width: 900px) {
    .research-sidebar-toggle { display: block; }
    .research-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .research-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }
    .research-main { margin-left: 0; padding: 4rem 1.25rem 2rem; }
}

.research-subtitle { color: var(--text-muted); margin-bottom: 2rem; }
