/* ════════════════════════════════════════════
   INSIGHT — Reusable Components
   Cards, Buttons, Grids, Tags, Projects
   ════════════════════════════════════════════ */

/* ────────────────────────────────────────────
   BUTTONS
──────────────────────────────────────────── */
.btn {
    display: inline-block; padding: 0.875rem 2rem;
    border-radius: 8px; font-size: 1rem; font-weight: 500; transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); }

.btn-white {
    background: white; color: var(--primary);
    padding: 1rem 2rem; border-radius: 8px;
    font-weight: 700; font-size: 1.1rem; display: inline-block; transition: all 0.2s;
}
.btn-white:hover { background: var(--bg-subtle); }

.btn-filled-teal, .btn-filled-indigo, .btn-filled-green {
    padding: 0.75rem 1.75rem; border-radius: 8px; color: white;
    font-weight: 700; font-size: 0.95rem; display: inline-block;
    border: none; cursor: pointer; transition: all 0.2s;
}
.btn-filled-teal   { background: var(--color-capture); }
.btn-filled-indigo { background: var(--accent); }
.btn-filled-green  { background: var(--color-ai); }
.btn-filled-teal:hover   { background: #0284c7; transform: translateY(-1px); }
.btn-filled-indigo:hover { background: #3730a3; transform: translateY(-1px); }
.btn-filled-green:hover  { background: #059669; transform: translateY(-1px); }

.btn-outline-white {
    padding: 0.75rem 1.75rem; border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,0.4); color: white;
    font-weight: 700; font-size: 0.95rem; display: inline-block;
    cursor: pointer; background: transparent; transition: all 0.2s;
}
.btn-outline-white:hover { border-color: white; background: rgba(255,255,255,0.07); }

.btn-outline-primary {
    padding: 0.75rem 1.75rem; border-radius: 8px;
    border: 1.5px solid var(--border); color: var(--text);
    font-weight: 700; font-size: 0.95rem; display: inline-block;
    cursor: pointer; background: transparent; transition: all 0.2s;
}
.btn-outline-primary:hover { border-color: var(--accent); color: var(--accent); background: rgba(79,70,229,0.04); }

/* ────────────────────────────────────────────
   TAGS
──────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
    padding: 0.2rem 0.65rem; border-radius: 20px;
    font-size: 0.73rem; font-weight: 600;
    background: rgba(79,70,229,0.08); color: var(--accent);
    border: 1px solid rgba(79,70,229,0.18);
}
.tag-teal {
    padding: 0.2rem 0.65rem; border-radius: 20px;
    font-size: 0.73rem; font-weight: 600;
    background: rgba(14,165,233,0.08); color: var(--teal);
    border: 1px solid rgba(14,165,233,0.18);
}
.tag-green {
    padding: 0.2rem 0.65rem; border-radius: 20px;
    font-size: 0.73rem; font-weight: 600;
    background: rgba(16,185,129,0.08); color: var(--green);
    border: 1px solid rgba(16,185,129,0.18);
}
.flow-tag {
    padding: 0.3rem 0.8rem; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600;
    background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text);
}

/* ────────────────────────────────────────────
   CAPABILITY CARDS  (2-col grid, dept pages)
──────────────────────────────────────────── */
.cards-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem;
}
@media (max-width: 768px) { .cards-grid { grid-template-columns: 1fr; } }

.cap-card {
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 14px; padding: 1.75rem;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.cap-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 24px rgba(79,70,229,0.1);
    transform: translateY(-2px);
}
.cap-icon {
    width: 48px; height: 48px; background: rgba(79,70,229,0.08);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.1rem;
}
.cap-icon svg { width: 24px; height: 24px; }
.cap-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.6rem; }
.cap-card p  { font-size: 0.88rem; color: var(--text-light); line-height: 1.65; margin-bottom: 1rem; }

/* ────────────────────────────────────────────
   APPLICATION CARDS  (3-col, canvas + body)
──────────────────────────────────────────── */
.apps-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
@media (max-width: 900px) { .apps-grid { grid-template-columns: 1fr; } }

.app-card {
    background: white; border: 1.5px solid var(--border);
    border-radius: 14px; overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.app-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.1); transform: translateY(-3px); }
.app-canvas-wrap {
    height: 200px; background: var(--primary); position: relative;
}
.app-canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.app-body { padding: 1.35rem; }
.app-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.app-body p  { font-size: 0.85rem; color: var(--text-light); line-height: 1.6; margin-bottom: 0.75rem; }

/* ────────────────────────────────────────────
   GENERIC CARD  (landing page — products etc.)
──────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

.card {
    background: white; border: 1px solid var(--border);
    padding: 2rem; border-radius: 12px; transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
.card h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--primary); }
.card p  { font-size: 0.9rem; color: var(--text-light); }
.card-dark { background: var(--primary); color: white; }
.card-dark h4 { color: white; }
.card-dark p  { color: #cbd5e1; }

/* ────────────────────────────────────────────
   MINI 3D CANVAS CONTAINERS  (landing why-cards)
──────────────────────────────────────────── */
.mini-canvas {
    height: 120px; width: 100%;
    margin-bottom: 1rem; position: relative;
}

/* ────────────────────────────────────────────
   FLOW CARDS  (research chronology)
──────────────────────────────────────────── */
.flow-container {
    display: flex; flex-direction: column; gap: 2rem; position: relative;
}
.flow-container::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 2rem; width: 4px;
    background: linear-gradient(to bottom, var(--color-capture), var(--color-sim), var(--color-ai));
    border-radius: 4px; z-index: 0;
}
.flow-card {
    display: flex; background: white; border: 1px solid var(--border);
    border-radius: 16px; padding: 2.5rem; gap: 3rem;
    position: relative; z-index: 1; align-items: center;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05); transition: transform 0.3s;
}
.flow-card:hover { transform: translateX(10px); }
.flow-number {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 800; color: white;
    flex-shrink: 0; box-shadow: 0 0 0 8px white;
}
.num-1 { background: var(--color-capture); }
.num-2 { background: var(--color-sim); }
.num-3 { background: var(--color-ai); }
.flow-content { flex: 1; }
.flow-content h3 { font-size: 1.75rem; margin-bottom: 1rem; font-weight: 700; }
.flow-content p  { color: var(--text-light); margin-bottom: 1.5rem; font-size: 1.05rem; }
.tag-wrap { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ────────────────────────────────────────────
   FILTER TAG BARS  (research / team / projects / publications)
──────────────────────────────────────────── */
.filter-bar {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 2rem; justify-content: center;
}
.filter-tag {
    padding: 0.4rem 1.1rem; border-radius: 20px;
    font-size: 0.82rem; font-weight: 600;
    background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s;
    user-select: none;
}
.filter-tag:hover  { border-color: var(--accent); color: var(--accent); }
.filter-tag.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ────────────────────────────────────────────
   PUBLICATION CARDS
──────────────────────────────────────────── */
.publications-list {
    display: flex; flex-direction: column; gap: 1.25rem;
}
.pub-card {
    background: white; border: 1px solid var(--border);
    border-radius: 12px; padding: 1.5rem 1.75rem;
    transition: box-shadow 0.2s, transform 0.2s;
}
.pub-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.07); transform: translateY(-2px); }
.pub-meta {
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem;
}
.pub-badge {
    padding: 0.2rem 0.65rem; border-radius: 20px;
    font-size: 0.73rem; font-weight: 600;
    background: rgba(79,70,229,0.08); color: var(--accent);
    border: 1px solid rgba(79,70,229,0.18);
}
.pub-year { font-size: 0.8rem; color: var(--text-light); font-weight: 600; }
.pub-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--primary); }
.pub-authors { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.3rem; }
.pub-venue { font-size: 0.85rem; color: var(--text-light); font-style: italic; margin-bottom: 0.5rem; }
.pub-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.pub-link {
    font-size: 0.82rem; font-weight: 600; color: var(--accent);
    text-decoration: none;
}
.pub-link:hover { text-decoration: underline; }
.pub-theme-link { color: var(--color-capture); }
.pub-theme-tag {
    font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem;
    border-radius: 20px; background: rgba(16,185,129,0.08);
    color: var(--color-ai); border: 1px solid rgba(16,185,129,0.2);
}
.project-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.75rem; }
.project-theme-link { color: var(--color-capture) !important; }
.btn-flow {
    display: inline-block; margin-top: 1.5rem;
    font-weight: 600; text-decoration: underline; text-underline-offset: 4px;
}
.btn-1 { color: var(--color-capture); }
.btn-2 { color: var(--color-sim); }
.btn-3 { color: var(--color-ai); }
@media (max-width: 900px) {
    .flow-card { flex-direction: column; gap: 1.5rem; padding: 2rem; text-align: center; }
    .flow-container::before { left: 50%; transform: translateX(-50%); }
    .flow-number { margin: 0 auto; box-shadow: 0 0 0 6px var(--bg-subtle); }
}

/* ────────────────────────────────────────────
   PROJECTS GRID  (Firestore-powered, dynamic)
──────────────────────────────────────────── */
.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem;
}
.project-card {
    background: white; border: 1.5px solid var(--border);
    border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}
.project-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.08); transform: translateY(-2px);
}
.project-img {
    width: 100%; height: 175px; object-fit: cover; display: block; flex-shrink: 0;
}
.project-img-placeholder {
    width: 100%; height: 175px; flex-shrink: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    display: flex; align-items: center; justify-content: center;
}
.project-img-placeholder span {
    font-size: 2.5rem; opacity: 0.35;
}
.project-body {
    padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1;
}
.project-badge {
    display: inline-block; padding: 0.2rem 0.75rem; align-self: flex-start;
    border-radius: 20px; font-size: 0.72rem; font-weight: 600;
    background: rgba(79,70,229,0.08); color: var(--accent);
    border: 1px solid rgba(79,70,229,0.18); margin-bottom: 0.65rem;
}
.project-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--primary); line-height: 1.4; }
.project-card p  {
    font-size: 0.83rem; color: var(--text-light); line-height: 1.55;
    margin-bottom: 1rem; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.project-link { font-size: 0.83rem; font-weight: 600; color: var(--accent); margin-top: auto; }
.project-link:hover { text-decoration: underline; }
.loading-text { text-align: center; color: var(--text-light); padding: 3rem; font-size: 0.95rem; }

/* ────────────────────────────────────────────
   TEAM MEMBERS
──────────────────────────────────────────── */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.team-card {
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 14px; overflow: hidden; text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}
.team-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.07); transform: translateY(-2px); }
.team-avatar {
    width: 100%; height: 180px; object-fit: cover; object-position: top; display: block;
}
.team-avatar-placeholder {
    width: 100%; height: 180px;
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    display: flex; align-items: center; justify-content: center;
}
.team-avatar-placeholder span {
    font-size: 3rem; font-weight: 700; color: rgba(255,255,255,0.7);
}
.team-info { padding: 1rem 1rem 1.25rem; }
.team-info h4 { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.team-role { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.5rem; line-height: 1.4; }
.team-email { font-size: 0.75rem; color: var(--accent); font-weight: 500; word-break: break-all; }

/* ────────────────────────────────────────────
   PARTNERS GRID
──────────────────────────────────────────── */
.partners-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}
.partner-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
    min-width: 180px;
}
.partner-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-3px); }
.partner-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 0 auto 1rem;
}
.partner-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin: 0 0 0.25rem;
}
.partner-location {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

/* ────────────────────────────────────────────
   SUBSCRIBE / CONTACT BOX  (landing page)
──────────────────────────────────────────── */
.contact-box {
    max-width: 900px; width: 100%; margin: 0 auto;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 16px; padding: 4rem; text-align: center;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
}
.contact-box h2 { font-size: 2.25rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.contact-box p  { color: var(--text-light); font-size: 1.1rem; margin-bottom: 2.5rem; line-height: 1.6; }
/* Contact message form */
.contact-form { max-width: 620px; margin: 0 auto 2.5rem; text-align: left; }
.contact-form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.contact-form-row input { flex: 1; }
.contact-form input,
.contact-form textarea {
    width: 100%; padding: 0.875rem 1.25rem;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 1rem; font-family: inherit; outline: none;
    background: var(--bg-subtle); color: var(--text);
    transition: border-color 0.2s; box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); }
.contact-form textarea { resize: vertical; margin-bottom: 1rem; }
.contact-form .btn { width: 100%; }
.form-feedback { font-size: 0.9rem; margin-top: 0.75rem; min-height: 1.2em; }
.form-feedback.success { color: #10b981; }
.form-feedback.error   { color: #ef4444; }
.subscribe-label { font-size: 0.95rem; color: var(--text-light); margin-bottom: 1rem; }

.subscribe-form { display: flex; gap: 1rem; max-width: 500px; margin: 0 auto 3rem; }
.subscribe-form input {
    flex: 1; padding: 1rem 1.5rem;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 1rem; outline: none; transition: border-color 0.2s;
}
.subscribe-form input:focus { border-color: var(--accent); }
.contact-divider { border-top: 1px solid var(--border); margin: 0 auto 3rem; width: 60%; }
.contact-cols {
    display: flex; justify-content: space-around; text-align: left;
    max-width: 700px; margin: 0 auto; flex-wrap: wrap; gap: 2rem;
}
.contact-cols h4 { color: var(--primary); font-size: 1.1rem; margin-bottom: 0.5rem; font-weight: 600; }
.contact-cols p  { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; }
.contact-cols a  { color: var(--accent); font-weight: 500; }

/* ────────────────────────────────────────────
   NEWS & EVENTS CARDS
──────────────────────────────────────────── */
.news-section { padding: 5rem 0; background: var(--bg-subtle); }
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}
.news-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}
.news-image {
    height: 200px;
    position: relative;
    background: linear-gradient(135deg, var(--accent), var(--color-capture));
}
.news-image.event { background: linear-gradient(135deg, var(--color-ai), #3b82f6); }
.news-image.partnership { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.news-badge {
    position: absolute;
    top: 1rem; left: 1rem;
    background: rgba(255,255,255,0.95);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.news-badge.publication { color: var(--accent); }
.news-badge.event { color: var(--color-ai); }
.news-badge.partnership { color: #ea580c; }
.news-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.news-date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    display: block;
}
.news-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.news-excerpt {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}
.news-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap 0.2s;
}
.news-link:hover { gap: 0.75rem; }
.news-link svg { width: 16px; height: 16px; }
