/*
 * Beyond the Gate - Personal Website Template
 * 
 * Copyright (c) 2025 Kevin Mato. All rights reserved.
 * Licensed under MIT with Attribution Requirement.
 * https://github.com/KevinMTO/beyond-gate
 * 
 * If you use this template, you must include attribution to Kevin Mato.
 * See LICENSE file for full terms.
 * 
 * ---
 * 
 * Color Palette: Quantum Purple
 * Primary: #1a1a2e (deep space)
 * Secondary: #6366f1 (indigo)
 * Accent: #a855f7 (violet)
 * Hover: #4f46e5
 * Text: #1a1a2e
 * Light: #f5f5fa
 * White: #ffffff
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1a1a2e;
    background-color: #ffffff;
    line-height: 1.6;
}

/* Container and layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4a 100%);
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #e0e0e8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #a855f7;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .nav-container {
        padding: 0 15px;
    }
}

/* Main content */
main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* Hero section (homepage) */
.hero {
    text-align: center;
    padding: 4rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.hero h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #6366f1;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #5a5a7a;
}

.hero-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #6366f1;
    border-color: #6366f1;
}

.btn-secondary:hover {
    background: #6366f1;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Quick links grid (homepage) */
.quick-links {
    padding: 4rem 0;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.link-card {
    background: #ffffff;
    border: 1px solid #e8e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.05);
    text-align: center;
}

.link-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
}

.link-card h3 {
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.link-card p {
    color: #5a5a7a;
    font-size: 0.95rem;
}

/* Page headers */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: #5a5a7a;
    max-width: 600px;
    margin: 0 auto;
}

/* About page styles */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    color: #1a1a2e;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8e8f0;
}

.about-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.about-section li {
    margin-bottom: 0.5rem;
}

/* Projects page styles */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: #ffffff;
    border: 1px solid #e8e8f0;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.05);
    transition: all 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
}

.project-card h3 {
    color: #1a1a2e;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.project-card p {
    color: #5a5a7a;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #4f46e5;
}

/* NVIDIA Project Card - Special Styling */
.project-card.nvidia-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #3d3d3d;
    color: #ffffff;
}

.project-card.nvidia-card:hover {
    box-shadow: 0 8px 24px rgba(118, 185, 0, 0.3);
    border-color: #76b900;
}

.project-card.nvidia-card h3 {
    color: #76b900;
}

.project-card.nvidia-card p {
    color: #b0b0b0;
}

.project-card.nvidia-card .project-tech {
    color: #909090;
}

.project-card.nvidia-card .project-link {
    color: #76b900;
}

.project-card.nvidia-card .project-link:hover {
    color: #8ed000;
}

/* TUM Project Card - Special Styling */
.project-card.tum-card {
    background: linear-gradient(135deg, #003359 0%, #0065BD 100%);
    border: 1px solid #005293;
    color: #ffffff;
}

.project-card.tum-card:hover {
    box-shadow: 0 8px 24px rgba(0, 101, 189, 0.4);
    border-color: #64A0C8;
}

.project-card.tum-card h3 {
    color: #ffffff;
}

.project-card.tum-card p {
    color: #d0e4f5;
}

.project-card.tum-card .project-tech {
    color: #a0c8e8;
}

.project-card.tum-card .project-link {
    color: #64A0C8;
}

.project-card.tum-card .project-link:hover {
    color: #ffffff;
}

.project-card.tum-card a {
    color: #64A0C8;
}

.project-card.tum-card a:hover {
    color: #ffffff;
}

/* Blog page styles */
.blog-posts {
    max-width: 800px;
    margin: 0 auto;
}

.blog-post-preview {
    background: #ffffff;
    border: 1px solid #e8e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.05);
    transition: all 0.3s ease;
}

.blog-post-preview:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.blog-post-preview h2 {
    color: #1a1a2e;
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.blog-post-preview h2 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-post-preview h2 a:hover {
    color: #6366f1;
}

.blog-post-meta {
    color: #5a5a7a;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.blog-post-excerpt {
    color: #1a1a2e;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #4f46e5;
}

/* Individual blog post styles */
.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    color: #4f46e5;
}

.blog-post {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e8e8f0;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.05);
}

.blog-post h1 {
    color: #1a1a2e;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.blog-post-meta {
    color: #5a5a7a;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8e8f0;
}

.blog-post-content {
    line-height: 1.7;
}

.blog-post-content h2 {
    font-size: 1.6rem;
    color: #1a1a2e;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-post-content h3 {
    font-size: 1.3rem;
    color: #1a1a2e;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-post-content h4 {
    color: #1a1a2e;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content code {
    background: #f0f0f8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #6366f1;
}

.blog-post-content pre {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4a 100%);
    color: #e0e0e8;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.blog-post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Post navigation */
.post-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e8e8f0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.post-nav-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #6366f1;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.post-nav-link:hover {
    background: #6366f1;
    color: #ffffff;
}

/* Contact page styles */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-info {
    margin-bottom: 3rem;
}

.contact-item {
    margin-bottom: 2rem;
}

.contact-item h3 {
    color: #1a1a2e;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.contact-item a {
    color: #6366f1;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #4f46e5;
}

.contact-links h3 {
    color: #1a1a2e;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-block;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.contact-note {
    background: #f5f5fa;
    padding: 2rem;
    border-radius: 12px;
    text-align: left;
}

.contact-note h3 {
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.contact-note p {
    color: #5a5a7a;
    line-height: 1.6;
}

/* Loading state */
.loading {
    text-align: center;
    color: #5a5a7a;
    font-style: italic;
    padding: 2rem;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4a 100%);
    color: #e0e0e8;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-links {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .link-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-post {
        padding: 2rem 1.5rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .social-links {
        flex-direction: row;
        justify-content: center;
    }
    
    .social-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .post-navigation {
        flex-direction: column;
    }
    
    .post-nav-link {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .blog-post {
        padding: 1.5rem 1rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Print styles */
@media print {
    .navbar,
    footer {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .blog-post {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}

img[alt="Kevin Mato"] {
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.2);
    border-radius: 50%;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: transparent;
    border: none;
    color: #e0e0e8;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   DARK MODE STYLES
   ============================================ */

body.dark-mode {
    background-color: #0f0f1a;
    color: #e0e0e8;
}

/* Dark Mode - Navigation */
body.dark-mode .navbar {
    background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Dark Mode - Hero */
body.dark-mode .hero h1 {
    color: #ffffff;
}

body.dark-mode .hero h2 {
    color: #a855f7;
}

body.dark-mode .hero p {
    color: #a0a0b8;
}

/* Dark Mode - Cards */
body.dark-mode .link-card,
body.dark-mode .project-card,
body.dark-mode .blog-post-preview,
body.dark-mode .blog-post {
    background: #1a1a2e;
    border-color: #2d2d4a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .link-card:hover,
body.dark-mode .project-card:hover,
body.dark-mode .blog-post-preview:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

body.dark-mode .link-card h3,
body.dark-mode .project-card h3,
body.dark-mode .blog-post-preview h2,
body.dark-mode .blog-post h1 {
    color: #ffffff;
}

body.dark-mode .link-card p,
body.dark-mode .project-card p,
body.dark-mode .blog-post-excerpt {
    color: #a0a0b8;
}

/* Dark Mode - Page Headers */
body.dark-mode .page-header h1 {
    color: #ffffff;
}

body.dark-mode .page-header p {
    color: #a0a0b8;
}

/* Dark Mode - About Section */
body.dark-mode .about-section h2 {
    color: #ffffff;
    border-bottom-color: #2d2d4a;
}

body.dark-mode .about-section p,
body.dark-mode .about-section li {
    color: #c0c0d0;
}

/* Dark Mode - Blog */
body.dark-mode .blog-post-meta {
    color: #8080a0;
    border-bottom-color: #2d2d4a;
}

body.dark-mode .blog-post-content {
    color: #d0d0e0;
}

body.dark-mode .blog-post-content h2,
body.dark-mode .blog-post-content h3,
body.dark-mode .blog-post-content h4 {
    color: #ffffff;
}

body.dark-mode .blog-post-content code {
    background: #2d2d4a;
    color: #a855f7;
}

/* Dark Mode - Contact */
body.dark-mode .contact-item h3,
body.dark-mode .contact-links h3 {
    color: #ffffff;
}

body.dark-mode .contact-note {
    background: #1a1a2e;
}

body.dark-mode .contact-note h3 {
    color: #ffffff;
}

body.dark-mode .contact-note p {
    color: #a0a0b8;
}

/* Dark Mode - Tables */
body.dark-mode table {
    background: #1a1a2e;
}

body.dark-mode th {
    background: #2d2d4a;
    color: #ffffff;
}

body.dark-mode td {
    border-color: #2d2d4a;
    color: #c0c0d0;
}

body.dark-mode td a {
    color: #a855f7;
}

/* Dark Mode - Buttons */
body.dark-mode .btn-secondary {
    color: #a855f7;
    border-color: #a855f7;
}

body.dark-mode .btn-secondary:hover {
    background: #a855f7;
    color: #ffffff;
}

/* Dark Mode - Post Navigation */
body.dark-mode .post-navigation {
    border-top-color: #2d2d4a;
}

body.dark-mode .post-nav-link {
    color: #a855f7;
    border-color: #a855f7;
}

body.dark-mode .post-nav-link:hover {
    background: #a855f7;
    color: #ffffff;
}

/* Dark Mode - Footer */
body.dark-mode footer {
    background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 100%);
}

/* Dark Mode - Quick Links Section */
body.dark-mode .quick-links h2 {
    color: #ffffff;
}

/* Dark Mode - Image */
body.dark-mode img[alt="Kevin Mato"] {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Dark Mode - Contact Page Cards */
body.dark-mode .contact-card {
    background: #1a1a2e !important;
}

body.dark-mode .contact-card h2 {
    color: #ffffff !important;
}

body.dark-mode .contact-card p {
    color: #a0a0b8 !important;
}

body.dark-mode .links-table td {
    border-bottom-color: #2d2d4a !important;
}

body.dark-mode .links-table td:first-child {
    color: #ffffff !important;
}

body.dark-mode .links-table a {
    color: #a855f7 !important;
}

/* Dark Mode - Misc backgrounds */
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background:#f8f9fa"] {
    background: #1a1a2e !important;
}

body.dark-mode [style*="color: #666"] {
    color: #a0a0b8 !important;
}

body.dark-mode [style*="color: #2c3e50"] {
    color: #ffffff !important;
}

/* Dark Mode - Publications */
body.dark-mode .publication-card {
    background: #1a1a2e;
    border-color: #2d2d4a;
}

body.dark-mode .publication-card:hover {
    border-color: #6366f1;
}

/* Transition for smooth mode switch */
body, 
body *:not(.dark-mode-toggle) {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
