/* === CARDIOSENSE NEW UI - PART 3: INSIGHTS & ABOUT PAGES === */

/* ==================== INSIGHTS PAGE ==================== */
.insights-page {
    padding: calc(80px + var(--space-2xl)) 0 var(--space-3xl);
}

.page-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-3xl);
}

.page-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-md);
}

.page-header h1 {
    margin-bottom: var(--space-md);
}

.page-header p {
    font-size: 1.125rem;
}

/* Insight Sections with Glassmorphism */
.insight-section {
    padding: var(--space-2xl);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px) saturate(150%);
    -webkit-backdrop-filter: blur(5px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-2xl);
    margin-bottom: var(--space-2xl);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.04),
        0 2px 8px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.insight-section:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .insight-section {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .insight-section:hover {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 4px 16px rgba(0, 0, 0, 0.15);
}

.insight-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.insight-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 1.5rem;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.insight-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.insight-header p {
    font-size: 0.95rem;
}

/* Model Cards */
.model-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.model-card {
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: all var(--transition-base);
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.model-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
}

.model-icon.rf {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.model-icon.xgb {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.model-icon.gb {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.model-icon.lr {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.model-card h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.model-card p {
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.model-tag {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

/* Ensemble Explanation */
.ensemble-explanation {
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.ensemble-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.ensemble-input,
.ensemble-output,
.ensemble-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.ensemble-input i,
.ensemble-output i,
.ensemble-result i {
    font-size: 1.25rem;
    color: var(--primary);
}

.ensemble-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
}

.ensemble-models {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.ensemble-models span {
    padding: var(--space-sm) var(--space-md);
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-align: center;
}

.ensemble-explanation>p {
    text-align: center;
    font-size: 0.95rem;
}

/* Metrics Dashboard */
.metrics-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.metric-card {
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    text-align: center;
}

.metric-card.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.metric-card.primary h3,
.metric-card.primary p {
    color: white;
}

.metric-card.primary .metric-value {
    color: white;
}

.metric-card.primary .metric-bg {
    stroke: rgba(255, 255, 255, 0.2);
}

.metric-card.primary .metric-fill {
    stroke: white;
}

.metric-circle {
    position: relative;
    width: 115px;
    height: 115px;
    margin: 0 auto var(--space-md);
}

.metric-circle svg {
    transform: rotate(-90deg);
}

.metric-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.metric-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray var(--transition-slow);
}

.metric-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.metric-card h3 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.metric-card p {
    font-size: 0.8rem;
    margin: 0;
}

/* Dataset Info */
.dataset-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.dataset-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.dataset-stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.dataset-source {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.dataset-source>i {
    font-size: 2.5rem;
    color: #20beff;
}

.dataset-source h4 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.dataset-source p {
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.dataset-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.dataset-link:hover {
    text-decoration: underline;
}

/* SHAP Explanation */
.shap-explanation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
}

.shap-content h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
}

.shap-content>p {
    margin-bottom: var(--space-lg);
}

.shap-benefits {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.95rem;
}

.benefit-item i {
    color: var(--success);
}

.shap-visual {
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.shap-example h4 {
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.shap-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.shap-feature {
    width: 140px;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.shap-bar-fill {
    height: 8px;
    border-radius: var(--radius-full);
    flex: 1;
}

.shap-bar.positive .shap-bar-fill {
    background: linear-gradient(90deg, var(--warning) 0%, var(--danger) 100%);
}

.shap-bar.negative .shap-bar-fill {
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
}

.shap-direction {
    font-size: 0.8rem;
    font-weight: 600;
    width: 50px;
    text-align: right;
}

.shap-bar.positive .shap-direction {
    color: var(--danger);
}

.shap-bar.negative .shap-direction {
    color: var(--success);
}

/* Education Section */
.education-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.education-card {
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.edu-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.education-card h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.education-card>p {
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.edu-ranges {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.edu-ranges .range {
    font-size: 0.8rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.range.good {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--success);
}

.range.warning {
    background: rgba(var(--warning-rgb), 0.1);
    color: var(--warning);
}

.range.danger {
    background: rgba(var(--danger-rgb), 0.1);
    color: var(--danger);
}

.edu-fact {
    padding: var(--space-md);
    background: rgba(var(--primary-rgb), 0.05);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

/* Insight CTA */
.insight-cta {
    text-align: center;
    padding: var(--space-3xl);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
}

.insight-cta h2 {
    margin-bottom: var(--space-md);
}

.insight-cta p {
    font-size: 1.1rem;
    margin-bottom: var(--space-xl);
}

/* ==================== ABOUT PAGE ==================== */
.about-page {
    padding: calc(80px + var(--space-2xl)) 0 var(--space-3xl);
}

/* About Hero */
.about-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    margin-bottom: var(--space-3xl);
}

.about-hero-content h1 {
    margin-bottom: var(--space-lg);
}

.about-hero-content p {
    font-size: 1.125rem;
}

.about-hero-visual {
    position: relative;
    height: 300px;
}

.floating-icons {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass-darker);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.floating-icon.icon-1 {
    top: 10%;
    left: 20%;
    animation: float1 4s ease-in-out infinite;
    color: var(--danger);
}

.floating-icon.icon-2 {
    top: 30%;
    right: 10%;
    animation: float2 4s ease-in-out infinite 0.5s;
}

.floating-icon.icon-3 {
    bottom: 30%;
    left: 10%;
    animation: float3 4s ease-in-out infinite 1s;
    color: var(--success);
}

.floating-icon.icon-4 {
    bottom: 10%;
    right: 30%;
    animation: float1 4s ease-in-out infinite 1.5s;
    color: var(--accent);
}

/* About Sections */
.about-section {
    padding: var(--space-2xl);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    margin-bottom: var(--space-2xl);
}

.about-section h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
}

/* Mission */
.mission-content>p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: var(--space-xl);
}

.mission-stats {
    display: flex;
    gap: var(--space-3xl);
    justify-content: center;
}

.mission-stat {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.mission-stat .stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.mission-stat .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* About Features */
.about-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.about-feature {
    text-align: center;
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.about-feature .feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 1.25rem;
    border-radius: var(--radius-lg);
}

.about-feature h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.about-feature p {
    font-size: 0.9rem;
}

/* Tech Stack */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.tech-category {
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.tech-category h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
    color: var(--primary);
}

.tech-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.tech-item {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Developer Section */
.developer-card {
    display: flex;
    gap: var(--space-2xl);
    align-items: center;
}

.developer-avatar {
    flex-shrink: 0;
}

.developer-avatar img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-full);
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
}

.developer-info h2 {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.developer-info h3 {
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

.developer-title {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.developer-bio {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.social-link.github {
    color: #333;
}

[data-theme="dark"] .social-link.github {
    color: #f0f0f0;
}

.social-link.linkedin {
    color: #0077b5;
}

.social-link.twitter {
    color: #1da1f2;
}

.social-link.email {
    color: var(--primary);
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.social-link.github:hover {
    background: #333;
    color: white;
    border-color: #333;
}

.social-link.linkedin:hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.social-link.twitter:hover {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

.social-link.email:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Project Links */
.project-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.project-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition-base);
}

.project-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.project-link>i:first-child {
    font-size: 2rem;
    color: var(--primary);
}

.project-link>i:last-child {
    margin-left: auto;
    color: var(--text-muted);
}

.project-link h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.project-link p {
    font-size: 0.85rem;
    margin: 0;
}

/* About Disclaimer */
.about-disclaimer {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-xl);
    background: rgba(var(--primary-rgb), 0.05);
    backdrop-filter: blur(5px) saturate(150%);
    -webkit-backdrop-filter: blur(5px) saturate(150%);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-2xl);
}

.about-disclaimer>i {
    color: var(--primary);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.about-disclaimer h4 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.about-disclaimer p {
    font-size: 0.9rem;
    margin: 0;
}

/* About CTA */
.about-cta {
    text-align: center;
    padding: var(--space-3xl);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-2xl);
}

.about-cta h2 {
    color: white;
    margin-bottom: var(--space-md);
}

.about-cta p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: var(--space-xl);
}

/* ==================== CHARTS SECTION ==================== */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.charts-row:last-child {
    grid-template-columns: 1fr 2fr;
}

.chart-card {
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.chart-card.wide {
    grid-column: span 1;
}

.chart-card.small {
    grid-column: span 1;
}

.chart-header {
    margin-bottom: var(--space-lg);
}

.chart-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

.chart-header h3 i {
    color: var(--primary);
}

.chart-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.chart-container {
    position: relative;
    overflow: hidden;
}

/* Confusion Matrix */
.confusion-matrix {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    overflow-x: auto;
    min-width: 0;
}

.matrix-header {
    display: grid;
    grid-template-columns: 80px minmax(80px, 1fr) minmax(80px, 1fr);
    gap: var(--space-xs);
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding-bottom: var(--space-sm);
}

.matrix-row {
    display: grid;
    grid-template-columns: 80px minmax(80px, 1fr) minmax(80px, 1fr);
    gap: var(--space-xs);
}

.row-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-secondary);
    word-break: break-word;
}

.matrix-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 0;
}

.matrix-cell strong {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

.matrix-cell small {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.matrix-cell.tn,
.matrix-cell.tp {
    background: rgba(var(--success-rgb), 0.15);
}

.matrix-cell.tn strong,
.matrix-cell.tp strong {
    color: var(--success);
}

.matrix-cell.fp,
.matrix-cell.fn {
    background: rgba(var(--danger-rgb), 0.1);
}

.matrix-cell.fp strong,
.matrix-cell.fn strong {
    color: var(--danger);
}

/* Model Info Grid */
.info-card-grid {
    display: flex;
    flex-direction: column;
}

.model-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-item i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.info-item div {
    display: flex;
    flex-direction: column;
}

.info-item strong {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.info-item span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== RESPONSIVE MEDIA QUERIES ==================== */
/*
 * Comprehensive responsive design for all device sizes
 * Breakpoint Strategy:
 * - 1400px+     : Extra Large Desktop
 * - 1200-1399px : Large Desktop  
 * - 992-1199px  : Desktop/Laptop
 * - 768-991px   : Tablet (Portrait & Landscape)
 * - 576-767px   : Large Mobile (Phablets)
 * - 400-575px   : Mobile
 * - 320-399px   : Small Mobile
 * - <320px      : Extra Small Mobile
 */

/* ========== EXTRA LARGE DESKTOP: 1400px and above ========== */
@media (min-width: 1400px) {

    /* Container sizing for extra large screens */
    .container {
        max-width: 1320px;
    }

    /* Enhanced spacing for large displays */
    .page-header {
        max-width: 800px;
    }

    .insight-section {
        padding: var(--space-3xl);
    }
}

/* ========== LARGE DESKTOP: 1200px - 1399px ========== */
@media (max-width: 1399px) {

    /* Container adjustments */
    .container {
        max-width: 1140px;
    }

    /* Maintain optimal reading width */
    .page-header {
        max-width: 750px;
    }
}

/* ========== DESKTOP/LAPTOP: 992px - 1199px ========== */
@media (max-width: 1199px) {

    /* Container sizing */
    .container {
        max-width: 960px;
    }

    /* Grid adjustments for medium screens */
    .model-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .about-features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .project-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Spacing refinements */
    .education-grid,
    .tech-grid {
        gap: var(--space-lg);
    }
}

/* ========== TABLET: 768px - 991px ========== */
@media (max-width: 991px) {

    /* Container and spacing */
    .container {
        max-width: 720px;
        padding: 0 var(--space-lg);
    }

    /* Page structure adjustments */
    .insights-page,
    .about-page {
        padding: calc(70px + var(--space-xl)) 0 var(--space-2xl);
    }

    /* Typography scaling */
    .page-header {
        margin-bottom: var(--space-2xl);
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* Section adjustments */
    .insight-section {
        padding: var(--space-xl);
    }

    .insight-header {
        gap: var(--space-md);
    }

    .insight-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .insight-header h2 {
        font-size: 1.25rem;
    }

    /* Grid layouts - 2 columns */
    .model-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .metrics-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .education-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Single column layouts */
    .dataset-info {
        grid-template-columns: 1fr;
    }

    .shap-explanation {
        grid-template-columns: 1fr;
    }

    .about-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .project-links-grid {
        grid-template-columns: 1fr;
    }

    /* Developer section */
    .developer-card {
        flex-direction: column;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    /* Charts */
    .charts-row,
    .charts-row:last-child {
        grid-template-columns: 1fr;
    }

    /* Ensemble explanation */
    .ensemble-visual {
        flex-direction: column;
        gap: var(--space-lg);
    }

    .ensemble-arrow {
        transform: rotate(90deg);
        font-size: 1.25rem;
    }

    .ensemble-models {
        grid-template-columns: repeat(2, 1fr);
        max-width: 280px;
        margin: 0 auto;
    }

    .ensemble-input,
    .ensemble-output,
    .ensemble-result {
        min-width: 200px;
    }

    /* Dataset stats */
    .dataset-stats {
        flex-direction: column;
        gap: var(--space-lg);
    }
}

/* ========== LARGE MOBILE: 576px - 767px ========== */
@media (max-width: 767px) {

    /* Container and spacing */
    .container {
        max-width: 540px;
        padding: 0 var(--space-md);
    }

    /* Page structure */
    .insights-page,
    .about-page {
        padding: calc(60px + var(--space-lg)) 0 var(--space-xl);
    }

    /* Typography scaling */
    .page-badge {
        font-size: 0.8rem;
    }

    .page-header {
        margin-bottom: var(--space-xl);
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header p {
        font-size: 0.95rem;
    }

    /* Section styling */
    .insight-section {
        padding: var(--space-lg);
        margin-bottom: var(--space-xl);
    }

    .insight-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: var(--space-lg);
    }

    .insight-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .insight-header h2 {
        font-size: 1.1rem;
    }

    .insight-header p {
        font-size: 0.85rem;
    }

    /* Grid layouts - single column */
    .model-cards {
        grid-template-columns: 1fr;
    }

    .metrics-dashboard {
        grid-template-columns: 1fr;
    }

    .education-grid {
        grid-template-columns: 1fr;
    }

    .about-features-grid {
        grid-template-columns: 1fr;
    }

    /* Model cards */
    .model-card {
        padding: var(--space-lg);
    }

    /* Education cards */
    .education-card {
        padding: var(--space-lg);
    }

    .education-card h3 {
        font-size: 1rem;
    }

    .education-card p {
        font-size: 0.85rem;
    }

    /* About page elements */
    .about-hero {
        padding: var(--space-xl);
        text-align: center;
    }

    .about-hero h1 {
        font-size: 2rem;
    }

    .floating-icons {
        height: 200px;
    }

    .floating-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    /* Tech categories */
    .tech-category {
        padding: var(--space-lg);
    }

    /* Confusion matrix */
    .model-info-grid {
        grid-template-columns: 1fr;
    }

    .matrix-header,
    .matrix-row {
        grid-template-columns: 80px 1fr 1fr;
    }

    .matrix-cell {
        padding: var(--space-md);
    }

    .matrix-cell strong {
        font-size: 1.25rem;
    }
}

/* ========== MOBILE: 400px - 575px ========== */
@media (max-width: 575px) {

    /* Container and spacing */
    .container {
        padding: 0 var(--space-sm);
    }

    /* Page structure */
    .insights-page,
    .about-page {
        padding: calc(60px + var(--space-md)) 0 var(--space-lg);
    }


    /* Typography scaling */
    .page-header h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    /* Section styling */
    .insight-section {
        padding: var(--space-md);
    }

    .insight-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .insight-header h2 {
        font-size: 1rem;
    }

    .insight-header p {
        font-size: 0.8rem;
    }

    /* Model cards */
    .model-card {
        padding: var(--space-md);
    }

    .model-icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }

    .model-card h3 {
        font-size: 0.95rem;
    }

    .model-card p {
        font-size: 0.8rem;
    }

    .model-tag {
        font-size: 0.7rem;
    }

    /* Ensemble models */
    .ensemble-models {
        grid-template-columns: repeat(, 1fr);
        max-width: 220px;
    }

    /* Metrics dashboard */
    .metric-card {
        padding: var(--space-lg);
    }

    .metric-circle {
        width: 100px;
        height: 100px;
    }

    .metric-value {
        font-size: 1.1rem;
    }

    .metric-card h3 {
        font-size: 0.9rem;
    }

    .metric-card p {
        font-size: 0.75rem;
    }

    /* Dataset info */
    .stat-number {
        font-size: 2rem;
    }

    .dataset-source {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .dataset-source>i {
        font-size: 2rem;
    }

    /* SHAP bars */
    .shap-feature {
        width: 100px;
        font-size: 0.8rem;
    }

    .shap-direction {
        width: 40px;
        font-size: 0.75rem;
    }

    /* Education cards */
    .education-card {
        padding: var(--space-md);
    }

    .edu-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .education-card h3 {
        font-size: 0.95rem;
    }

    .education-card>p {
        font-size: 0.8rem;
    }

    .edu-ranges .range {
        font-size: 0.75rem;
    }

    .edu-fact {
        font-size: 0.8rem;
    }

    /* Insight CTA */
    .insight-cta {
        padding: var(--space-2xl) var(--space-lg);
    }

    .insight-cta h2 {
        font-size: 1.25rem;
    }

    .insight-cta p {
        font-size: 1rem;
    }

    /* About hero */
    .about-hero {
        padding: var(--space-lg);
    }

    .about-hero h1 {
        font-size: 1.5rem;
    }

    .about-hero p {
        font-size: 0.9rem;
    }

    .about-hero-visual {
        height: 180px;
    }

    .floating-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    /* About section */
    .about-section {
        padding: var(--space-lg);
    }

    .about-section h2 {
        font-size: 1.25rem;
    }

    /* Mission content */
    .mission-content>p {
        font-size: 1rem;
    }

    .mission-stats {
        flex-direction: column;
        gap: var(--space-xl);
    }

    .mission-stat .stat-value {
        font-size: 2rem;
    }

    .mission-stat .stat-label {
        font-size: 0.85rem;
    }

    /* About features */
    .about-feature {
        padding: var(--space-lg);
    }

    .about-feature .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .about-feature h3 {
        font-size: 0.95rem;
    }

    .about-feature p {
        font-size: 0.85rem;
    }

    /* Tech stack */
    .tech-category {
        padding: var(--space-md);
    }

    .tech-category h3 {
        font-size: 0.9rem;
    }

    .tech-item {
        font-size: 0.75rem;
        padding: var(--space-xs);
    }

    /* Developer card */
    .developer-avatar img {
        width: 140px;
        height: 140px;
    }

    .developer-info h2 {
        font-size: 0.9rem;
    }

    .developer-info h3 {
        font-size: 1.5rem;
    }

    .developer-title {
        font-size: 0.95rem;
    }

    .developer-bio {
        font-size: 0.95rem;
    }

    /* Social links */
    .social-link {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }

    /* Project links */
    .project-link {
        padding: var(--space-lg);
    }

    .project-link>i:first-child {
        font-size: 1.5rem;
    }

    .project-link h4 {
        font-size: 0.95rem;
    }

    .project-link p {
        font-size: 0.8rem;
    }

    /* About disclaimer */
    .about-disclaimer {
        padding: var(--space-lg);
    }

    .about-disclaimer>i {
        font-size: 1.25rem;
    }

    .about-disclaimer h4 {
        font-size: 0.95rem;
    }

    .about-disclaimer p {
        font-size: 0.85rem;
    }

    /* About CTA */
    .about-cta {
        padding: var(--space-2xl) var(--space-lg);
    }

    .about-cta h2 {
        font-size: 1.5rem;
    }

    .about-cta p {
        font-size: 1rem;
    }

    /* Charts */
    .chart-card {
        padding: var(--space-lg);
    }

    .chart-header h3 {
        font-size: 1rem;
    }

    .chart-header p {
        font-size: 0.8rem;
    }

    /* Confusion matrix */
    .confusion-matrix {
        font-size: 0.85rem;
    }

    .matrix-header {
        font-size: 0.65rem;
        grid-template-columns: 70px 1fr 1fr;
    }

    .matrix-row {
        grid-template-columns: 70px 1fr 1fr;
    }

    .row-label {
        font-size: 0.65rem;
    }

    .matrix-cell {
        padding: var(--space-sm);
    }

    .matrix-cell strong {
        font-size: 1.1rem;
    }

    .matrix-cell small {
        font-size: 0.55rem;
    }

    /* Info items */
    .info-item {
        padding: var(--space-sm);
    }

    .info-item i {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .info-item strong {
        font-size: 0.8rem;
    }

    .info-item span {
        font-size: 0.75rem;
    }
}

/* ========== SMALL MOBILE: 320px - 399px ========== */
@media (max-width: 399px) {

    /* Further typography scaling */
    .page-header h1 {
        font-size: 1.35rem;
    }

    .page-header p {
        font-size: 0.85rem;
    }

    /* Section headers */
    .insight-header h2 {
        font-size: 0.95rem;
    }

    .insight-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Model cards */
    .model-icon {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    .model-card h3 {
        font-size: 0.9rem;
    }

    .model-card p {
        font-size: 0.75rem;
    }

    /* Metrics */
    .metric-circle {
        width: 90px;
        height: 90px;
    }

    .metric-value {
        font-size: 1rem;
    }

    .metric-card h3 {
        font-size: 0.85rem;
    }

    /* Dataset */
    .stat-number {
        font-size: 1.75rem;
    }

    .dataset-source>i {
        font-size: 1.75rem;
    }

    /* SHAP bars */
    .shap-feature {
        width: 80px;
        font-size: 0.75rem;
    }

    .shap-bar-fill {
        height: 6px;
    }

    /* Education */
    .edu-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .education-card h3 {
        font-size: 0.9rem;
    }

    .education-card>p {
        font-size: 0.75rem;
    }

    /* About */
    .about-hero h1 {
        font-size: 1.35rem;
    }

    .about-hero-visual {
        height: 150px;
    }

    .floating-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .mission-stat .stat-value {
        font-size: 1.75rem;
    }

    /* About features */
    .about-feature .feature-icon {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .about-feature h3 {
        font-size: 0.9rem;
    }

    .about-feature p {
        font-size: 0.8rem;
    }

    /* Developer */
    .developer-avatar img {
        width: 120px;
        height: 120px;
    }

    .developer-info h3 {
        font-size: 1.35rem;
    }

    /* Social links */
    .social-link {
        font-size: 0.8rem;
        padding: var(--space-xs) var(--space-sm);
    }

    /* Charts */
    .chart-header h3 {
        font-size: 0.95rem;
    }

    .matrix-cell strong {
        font-size: 1rem;
    }

    .info-item i {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
}

/* ========== EXTRA SMALL MOBILE: < 320px ========== */
@media (max-width: 319px) {

    /* Minimal spacing */
    .container {
        padding: 0 var(--space-xs);
    }

    /* Typography */
    .page-header h1 {
        font-size: 1.25rem;
    }

    .insight-header h2 {
        font-size: 0.9rem;
    }

    /* Icons and elements */
    .insight-icon,
    .model-icon,
    .edu-icon,
    .about-feature .feature-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Metrics */
    .metric-circle {
        width: 80px;
        height: 80px;
    }

    .metric-value {
        font-size: 0.9rem;
    }

    /* Stats */
    .stat-number {
        font-size: 1.5rem;
    }

    .mission-stat .stat-value {
        font-size: 1.5rem;
    }

    /* Avatar */
    .developer-avatar img {
        width: 100px;
        height: 100px;
    }

    /* Buttons and links */
    .btn,
    .social-link {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.75rem;
    }

    /* Matrix */
    .matrix-header,
    .matrix-row {
        grid-template-columns: 60px 1fr 1fr;
        font-size: 0.6rem;
    }

    .matrix-cell strong {
        font-size: 0.9rem;
    }
}

/* ========== LANDSCAPE ORIENTATION ADJUSTMENTS ========== */
@media (max-height: 600px) and (orientation: landscape) {

    /* Reduce vertical spacing in landscape */
    .insights-page,
    .about-page {
        padding: calc(60px + var(--space-md)) 0 var(--space-md);
    }

    .insight-section {
        padding: var(--space-md);
        margin-bottom: var(--space-md);
    }

    .about-hero-visual,
    .floating-icons {
        height: 150px;
    }

    .metric-circle {
        width: 90px;
        height: 90px;
    }
}

/* ========== HIGH RESOLUTION DISPLAYS ========== */
@media (min-resolution: 192dpi) {

    /* Enhance borders and shadows for retina displays */
    .insight-section,
    .model-card,
    .education-card,
    .about-feature,
    .chart-card {
        border-width: 0.5px;
    }

    .floating-icon,
    .social-link {
        border-width: 0.5px;
    }
}

/* ========== PRINT STYLES ========== */
@media print {

    /* Remove unnecessary elements for print */
    .floating-icons,
    .social-links,
    .about-cta {
        display: none;
    }

    /* Optimize for print */
    .insight-section,
    .about-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    /* Ensure readability */
    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1 {
        font-size: 24pt;
    }

    h2 {
        font-size: 18pt;
    }

    h3 {
        font-size: 14pt;
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {

    /* Disable animations for users who prefer reduced motion */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-icon {
        animation: none;
    }
}

/* ==================== END OF MEDIA QUERIES ==================== */