/* ==========================================
   NERD/HACKER TERMINAL THEME
   ========================================== */

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

:root {
    --bg-primary: #0c0c0c;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #0f0f0f;
    --terminal-bg: rgba(12, 12, 12, 0.95);
    --terminal-border: #00ff41;
    --text-primary: #00ff41;
    --text-secondary: #00cc33;
    --text-tertiary: #33ff66;
    --text-muted: #00aa2a;
    --accent-cyan: #00ffff;
    --accent-amber: #ffb000;
    --accent-red: #ff0040;
    --shadow-green: 0 0 10px rgba(0, 255, 65, 0.5);
    --shadow-green-lg: 0 0 20px rgba(0, 255, 65, 0.6);
    --font-mono: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Matrix Canvas Background */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
}

/* CRT Effect Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px
        );
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* Terminal Container */
.terminal-container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Terminal Window Base */
.terminal-window {
    background: var(--terminal-bg);
    border: 2px solid var(--terminal-border);
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-green-lg), inset 0 0 20px rgba(0, 255, 65, 0.05);
    animation: terminalBoot 0.5s ease-out;
}

@keyframes terminalBoot {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Terminal Header */
.terminal-header {
    background: rgba(0, 255, 65, 0.1);
    border-bottom: 1px solid var(--terminal-border);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.terminal-title {
    color: var(--text-primary);
    font-weight: 600;
    text-shadow: var(--shadow-green);
}

.terminal-badge {
    color: var(--accent-cyan);
    font-size: 0.8rem;
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
}

.control {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    font-weight: bold;
}

.control.minimize {
    background: #ffb000;
    color: #000;
}

.control.maximize {
    background: #00ff41;
    color: #000;
}

.control.close {
    background: #ff0040;
    color: #fff;
}

/* Terminal Content */
.terminal-content {
    padding: 2rem;
}

/* Navigation Terminal */
.terminal-nav {
    position: sticky;
    top: 1rem;
    z-index: 100;
    margin-bottom: 2rem;
}

.nav-content {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.prompt {
    color: var(--accent-amber);
    font-weight: 600;
}

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

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
    padding: 0.25rem 0.5rem;
}

.nav-link:hover {
    color: var(--accent-cyan);
    text-shadow: var(--shadow-green);
    background: rgba(0, 255, 65, 0.1);
}

.nav-link::before {
    content: '> ';
    opacity: 0;
    margin-right: -10px;
    transition: all 0.2s;
}

.nav-link:hover::before {
    opacity: 1;
    margin-right: 0;
}

.cursor-blink {
    animation: blink 1s infinite;
    color: var(--text-primary);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ASCII Art */
.ascii-art {
    color: var(--text-primary);
    font-size: clamp(0.5rem, 1.5vw, 1rem);
    line-height: 1.2;
    text-shadow: var(--shadow-green);
    margin-bottom: 2rem;
    overflow-x: auto;
}

/* Terminal Line */
.terminal-line {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.prompt-symbol {
    color: var(--accent-amber);
    margin-right: 0.5rem;
    font-weight: bold;
}

/* Typing Effect */
.typing-container {
    margin: 2rem 0;
}

.typed-text {
    color: var(--text-primary);
}

.typing-cursor {
    color: var(--text-primary);
    animation: blink 1s infinite;
}

/* Info Display */
.info-display {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 255, 65, 0.05);
    border-left: 3px solid var(--terminal-border);
}

.info-display p {
    margin: 0.5rem 0;
}

.key {
    color: var(--accent-cyan);
    font-weight: 700;
    margin-right: 0.5rem;
}

.value {
    color: var(--text-primary);
}

.blink {
    animation: blink 1s infinite;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    margin-left: 0.5rem;
    box-shadow: var(--shadow-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: var(--shadow-green);
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
    }
}

/* Command Prompt */
.command-prompt {
    margin: 2rem 0;
}

.bio-text {
    color: var(--text-secondary);
    padding: 1rem 0;
    line-height: 1.8;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.terminal-button {
    background: transparent;
    border: 2px solid var(--terminal-border);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.terminal-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 65, 0.1);
    transition: left 0.3s;
}

.terminal-button:hover::before {
    left: 0;
}

.terminal-button:hover {
    box-shadow: var(--shadow-green);
    text-shadow: var(--shadow-green);
}

.btn-icon {
    margin-right: 0.5rem;
}

/* Code Block */
.code-block {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 4px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Syntax Highlighting */
.comment { color: #666; font-style: italic; }
.keyword { color: var(--accent-cyan); font-weight: 600; }
.function { color: var(--accent-amber); }
.variable { color: #00ff41; }
.string { color: #00cc33; }
.number { color: var(--accent-amber); }
.json-key { color: var(--accent-cyan); }

/* Stats Display */
.stats-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    padding: 1rem;
    border: 1px solid rgba(0, 255, 65, 0.3);
    background: rgba(0, 255, 65, 0.05);
    transition: all 0.2s;
}

.stat-item:hover {
    border-color: var(--terminal-border);
    box-shadow: var(--shadow-green);
    transform: translateX(5px);
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

/* Git Log Styling */
.git-log {
    margin: 1.5rem 0;
}

.log-entry {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 2px solid rgba(0, 255, 65, 0.3);
    transition: all 0.2s;
}

.log-entry:hover {
    border-left-color: var(--terminal-border);
    background: rgba(0, 255, 65, 0.03);
}

.git-branch {
    color: var(--text-primary);
}

.branch-name {
    color: var(--accent-cyan);
    font-weight: 700;
}

.commit-hash {
    color: var(--accent-amber);
    margin: 0 0.5rem;
}

.commit-date {
    color: var(--text-muted);
}

.commit-message {
    margin: 0.5rem 0;
}

.role {
    color: var(--text-primary);
    font-weight: 700;
}

.commit-detail {
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.commit-desc {
    color: var(--text-muted);
    margin: 0.25rem 0 0.25rem 1rem;
}

/* Database Table */
.database-table {
    margin: 1.5rem 0;
}

.table-header {
    display: grid;
    grid-template-columns: 50px 3fr 80px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--terminal-border);
    font-weight: 700;
    color: var(--text-primary);
}

.table-row {
    display: grid;
    grid-template-columns: 50px 3fr 80px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-top: none;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.table-row:hover {
    background: rgba(0, 255, 65, 0.05);
    border-color: var(--terminal-border);
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 255, 65, 0.2);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--terminal-border);
}

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

.tedx-card {
    padding: 1.5rem;
    border: 2px solid rgba(0, 255, 65, 0.3);
    background: rgba(0, 255, 65, 0.03);
    transition: all 0.3s;
}

.tedx-card:hover {
    border-color: var(--terminal-border);
    box-shadow: var(--shadow-green);
    transform: scale(1.02);
}

.tedx-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
    filter: grayscale(1) brightness(2);
}

.tedx-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.tedx-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.tedx-card h3 a::after {
    content: ' ↗';
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.2s;
    color: var(--accent-cyan);
}

.tedx-card h3 a:hover {
    color: var(--accent-cyan);
    text-shadow: var(--shadow-green);
}

.tedx-card h3 a:hover::after {
    opacity: 1;
    margin-left: 0.25rem;
}

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

/* Academic Publications Section */
.scholar-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.scholar-metric {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    border: 2px solid rgba(0, 255, 65, 0.3);
    background: rgba(0, 255, 65, 0.03);
    transition: all 0.3s;
    align-items: center;
}

.scholar-metric:hover {
    border-color: var(--terminal-border);
    box-shadow: var(--shadow-green);
    transform: scale(1.02);
}

.metric-icon {
    font-size: 2.5rem;
    filter: grayscale(1) brightness(2);
    flex-shrink: 0;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: var(--shadow-green);
}

.metric-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.publications-list {
    margin: 2rem 0;
}

.pub-year-section {
    margin-bottom: 3rem;
}

.pub-year {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: var(--shadow-green);
}

.publication-item {
    background: rgba(0, 255, 65, 0.03);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-left: 3px solid var(--terminal-border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.publication-item:hover {
    background: rgba(0, 255, 65, 0.05);
    border-color: var(--terminal-border);
    box-shadow: var(--shadow-green);
    transform: translateX(5px);
}

.pub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pub-type {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-amber);
    background: rgba(255, 176, 0, 0.1);
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--accent-amber);
    border-radius: 3px;
}

.pub-citations {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
}

.pub-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

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

.pub-authors strong {
    color: var(--accent-cyan);
    font-weight: 700;
}

.pub-venue {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.pub-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.pub-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0, 255, 65, 0.15);
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 3px;
    transition: all 0.2s;
}

.pub-tag:hover {
    background: rgba(0, 255, 65, 0.25);
    border-color: var(--terminal-border);
}

.scholar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 1rem 1.5rem;
    border: 2px solid var(--terminal-border);
    background: rgba(0, 255, 65, 0.05);
    margin-top: 1rem;
    transition: all 0.3s;
    font-weight: 600;
}

.scholar-link:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: var(--shadow-green);
    transform: translateX(5px);
}

.scholar-link .link-icon {
    font-size: 1.2rem;
}

/* Conferences Section */
.conferences-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.conf-stat {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    border: 2px solid rgba(0, 255, 65, 0.3);
    background: rgba(0, 255, 65, 0.03);
    transition: all 0.3s;
    align-items: flex-start;
}

.conf-stat:hover {
    border-color: var(--terminal-border);
    box-shadow: var(--shadow-green);
    transform: translateY(-5px);
}

.conf-icon {
    font-size: 3rem;
    filter: grayscale(1) brightness(2);
    flex-shrink: 0;
}

.conf-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conf-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: var(--shadow-green);
}

.conf-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.conference-summary {
    margin-top: 3rem;
}

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

.contact-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border: 2px solid rgba(0, 255, 65, 0.3);
    background: rgba(0, 255, 65, 0.03);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}

.contact-link:hover {
    border-color: var(--terminal-border);
    box-shadow: var(--shadow-green);
    transform: translateX(5px);
}

.link-icon {
    font-size: 1.5rem;
    filter: grayscale(1) brightness(2);
}

.link-text {
    flex: 1;
    margin: 0 1rem;
}

.link-arrow {
    color: var(--accent-cyan);
    font-size: 1.2rem;
}

/* Footer */
.footer-terminal {
    background: var(--terminal-bg);
    border: 2px solid var(--terminal-border);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.footer-content p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.footer-binary {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 1rem;
    letter-spacing: 2px;
}

.heart {
    color: var(--accent-red);
}

/* Glitch Effect */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.terminal-window:hover .terminal-title {
    animation: glitch 0.3s infinite;
}

/* Scanline Effect */
@keyframes scan {
    0% {
        top: 0;
    }
    100% {
        top: 100%;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--terminal-border);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

/* Selection */
::selection {
    background: rgba(0, 255, 65, 0.3);
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .terminal-container {
        padding: 1rem;
    }

    .terminal-content {
        padding: 1rem;
    }

    .ascii-art {
        font-size: 0.5rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .table-header,
    .table-row {
        grid-template-columns: 40px 2fr 60px 1fr;
        font-size: 0.8rem;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .terminal-button {
        width: 100%;
    }

    .stats-display {
        grid-template-columns: 1fr;
    }

    .tedx-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .ascii-art {
        font-size: 0.4rem;
    }

    .table-header,
    .table-row {
        grid-template-columns: 30px 2fr 50px 1fr;
        font-size: 0.7rem;
    }
}

/* Loading Animation */
@keyframes boot {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

body {
    animation: boot 1s ease-in;
}

/* Text Glow on Hover */
.terminal-window:hover {
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.4), inset 0 0 20px rgba(0, 255, 65, 0.05);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
