/* CSS Design System for Dr. Ali Fares Academic Website */
:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(18, 26, 43, 0.75);
    --bg-card-hover: rgba(26, 38, 64, 0.85);
    --bg-alt: #080c14;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(0, 229, 255, 0.3);
    
    --accent-emerald: #00ffaa;
    --accent-cyan: #00e5ff;
    --accent-blue: #3b82f6;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

body {
    position: relative;
    overflow-x: hidden;
}

/* Background Canvas */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* Typography Utilities */
.gradient-text {
    background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-cyan) 50%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation Header */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-main);
}

.brand-dot {
    color: var(--accent-emerald);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--accent-cyan);
}

.nav-highlight {
    color: var(--accent-emerald);
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline, .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.925rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
    color: #040d1a;
    border: none;
    box-shadow: 0 4px 14px rgba(0, 255, 170, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 170, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-cyan);
}

.btn-outline {
    background: transparent;
    color: var(--accent-cyan);
    border: 1px solid var(--border-highlight);
}

.btn-outline:hover {
    background: rgba(0, 229, 255, 0.1);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.825rem;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 1.75rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
}

/* Sections */
.section {
    padding: 6rem 1.5rem;
}

.bg-alt {
    background-color: var(--bg-alt);
}

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

.section-header {
    margin-bottom: 3.5rem;
    text-align: center;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-emerald);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.section-desc {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0.75rem auto 0 auto;
    font-size: 1.05rem;
}

/* Hero Section */
.hero-section {
    padding: 9rem 1.5rem 5rem 1.5rem;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

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

.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    font-size: 0.825rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.badge-accent {
    background: rgba(0, 255, 170, 0.1);
    border-color: rgba(0, 255, 170, 0.3);
    color: var(--accent-emerald);
    font-weight: 600;
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    max-width: 950px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 850px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 4rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.metric-label {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

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

.about-card .about-icon {
    font-size: 2rem;
    color: var(--accent-emerald);
    margin-bottom: 1rem;
}

.about-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Research Spectrum */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.5rem;
}

.research-card .card-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.research-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.research-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-emerald);
    border: 1px solid rgba(0, 255, 170, 0.2);
}

/* APPA Console Sandbox */
.console-wrapper {
    padding: 0 !important;
    overflow: hidden;
    border-color: rgba(0, 229, 255, 0.2);
}

.console-header {
    background: #080c14;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.console-dots {
    display: flex;
    gap: 0.4rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.console-title {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pulse-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
    margin-right: 0.4rem;
}

.console-status {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-emerald);
}

.console-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 400px;
}

.console-sidebar {
    background: rgba(8, 12, 20, 0.6);
    border-right: 1px solid var(--border-color);
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.console-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
}

.console-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.console-tab-btn.active {
    background: rgba(0, 229, 255, 0.12);
    color: var(--accent-cyan);
    font-weight: 600;
    border: 1px solid var(--border-highlight);
}

.console-content {
    padding: 1.5rem;
}

.tool-panel {
    display: none;
}

.tool-panel.active {
    display: block;
}

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

.tool-header-flex h4 {
    font-size: 1.1rem;
    color: var(--text-main);
}

/* Vision Demo Box */
.vision-demo-box {
    width: 100%;
    height: 250px;
    background: #060911 url('https://images.unsplash.com/photo-1515162816999-a0c47dc192f7?q=80&w=800') center/cover no-repeat;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.crack-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease;
}

.crack-line {
    stroke-dasharray: 10;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to { stroke-dashoffset: -1000; }
}

.vision-info-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.75);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.tag-status.accuracy {
    color: var(--accent-emerald);
    border-color: rgba(0, 255, 170, 0.4);
}

.tool-caption {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* GPR Canvas & Rutting Canvas */
.gpr-canvas-container, .rutting-canvas-container {
    width: 100%;
    background: #04070e;
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
}

#gprCanvas, #ruttingCanvas {
    width: 100%;
    height: 220px;
    display: block;
}

.gpr-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.gpr-metric {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.gpr-metric .label {
    display: block;
    color: var(--text-muted);

}

.gpr-metric .value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-cyan);
}

/* LLM Chat Demo */
.llm-chat-box {
    background: #04070e;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;

}

.chat-msg {
    margin-bottom: 1rem;
}

.chat-msg.user {
    color: var(--accent-cyan);
    font-family: var(--font-mono);

}

.chat-msg.bot {
    background: rgba(255, 255, 255, 0.04);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent-emerald);
}

.chat-role {
    font-weight: 700;

    display: block;
    margin-bottom: 0.4rem;
}

.chat-meta {
    font-family: var(--font-mono);
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Fuzzy Calculator */
.calculator-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.slider-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.slider-group input[type="range"] {
    width: 100%;
    accent-color: var(--accent-cyan);
}

.calc-results-box {
    background: #04070e;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border-highlight);

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.result-item .res-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-item .res-val {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.result-item .res-val.highlight {
    color: var(--accent-emerald);
}

.result-item .res-val.action {
    color: var(--accent-cyan);
    font-size: 0.9rem;
}

.console-footer {
    background: #080c14;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.console-footer a {
    color: var(--accent-cyan);
    text-decoration: underline;
}

/* Publications Section */
.pub-controls {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.pub-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.pub-card {
    border-left: 3px solid var(--accent-cyan);
}

.pub-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pub-journal-badge {
    font-family: var(--font-mono);
    font-size: 0.775rem;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-cyan);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.pub-q1 {
    font-family: var(--font-mono);
    font-size: 0.775rem;
    background: rgba(0, 255, 170, 0.1);
    color: var(--accent-emerald);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.pub-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.pub-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;

}

.pub-abstract {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pub-footer {
    margin-top: 2.5rem;
    text-align: center;
}

.pub-footer p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Teaching Grid */
.teaching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.teaching-card ul {
    list-style: none;
    padding: 0;
}

.teaching-card li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.teaching-card li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-emerald);
}

/* Contact Box */
.contact-box {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 3.5rem 2rem;
}

.contact-details {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    color: var(--text-main);
    text-decoration: none;

}

.social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.social-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* Footer */
.footer {
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
    .console-body {
        grid-template-columns: 1fr;
    }
    .console-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        overflow-x: auto;
    }
    .console-tab-btn {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }
    .nav-links {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
}


/* ---------------------------------------------------------------------------
   Real APPA screenshot
   ---------------------------------------------------------------------------
   The console UI is a light interface and this page is near-black. Rather than
   dim the screenshot — which makes a crisp UI look muddy and slightly evasive —
   it sits inside a dark frame with padding, so the brightness change reads as
   deliberate. Hue was never the problem: APPA's indigo accent and this page's
   cyan are both cool, and the red crack overlay is the only warm element, which
   usefully draws the eye to the result.
-------------------------------------------------------------------------- */
.appa-shot {
    margin: 0 0 2rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.appa-shot picture,
.appa-shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.appa-shot figcaption {
    margin: 0.85rem 0.35rem 0.2rem;
    font-size: 0.86rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.62);
}
.appa-shot figcaption strong { color: rgba(255, 255, 255, 0.92); font-weight: 600; }
.appa-shot figcaption code {
    font-size: 0.94em;
    padding: 0.05em 0.35em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
}
@media (max-width: 640px) {
    .appa-shot { padding: 0.4rem; }
    .appa-shot figcaption { font-size: 0.8rem; }
}
