/* Modern CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-padding-top: var(--header-height);
    scroll-behavior: smooth;
}

/* Variables */
:root {
    /* Colors */
    --primary-color: #2563eb;
    --primary-color-rgb: 37, 99, 235;
    --secondary-color: #3b82f6;
    --secondary-color-rgb: 59, 130, 246;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --accent-color: #dbeafe;
    --border-color: #e5e7eb;
    --error-color: #ef4444;
    --success-color: #10b981;
    --visited-color: rgba(59, 130, 246, 0.2);

    /* Layout */
    --container-width: 75rem;
    --header-height: 3.5rem;
    --spacing-unit: 1rem;
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-color-rgb: 96, 165, 250;
    --secondary-color: #3b82f6;
    --secondary-color-rgb: 59, 130, 246;
    --text-color: #f3f4f6;
    --bg-color: #111827;
    --accent-color: #1f2937;
    --border-color: #374151;
}

/* Base styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.2;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
    font-size: 0.75rem;
    padding-top: 0;
}

/* Layout */
.container {
    width: 75%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem;
    z-index: 1000;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.375rem;
}

/* Typography */
h1 { 
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
}
h2 { 
    font-size: 1.35rem; 
    text-align: center;
    margin-bottom: 1.25rem;
}
h3 { font-size: 0.9rem; }
p { margin-bottom: 0.5rem; }

/* Layout */
section {
    padding: 2rem 0;
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 20vh;
    padding: calc(var(--header-height) + 2rem) 1rem 0;
    text-align: center;
}

.hero-content {
    max-width: 75%;
    margin: 0 auto;
}

.hero h1 {
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
}

.hero h2 {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.hero-text {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.social-links a {
    color: var(--text-color);
    font-size: 1.125rem;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Maze Section */
#maze.maze {
    padding-top: 0;
    padding-bottom: 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0;
}

#maze .container {
    max-width: 800px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.maze-grid {
    display: grid;
    grid-template-columns: repeat(15, 1.5625rem);
    grid-template-rows: repeat(15, 1.5625rem);
    gap: 0.0625rem;
    padding: 0.125rem;
    background-color: var(--border-color);
    border-radius: 0.25rem;
    margin: 1.25rem auto;
    width: fit-content;
    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
}

.cell {
    width: 1.5625rem;
    height: 1.5625rem;
    background-color: var(--bg-color);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.125rem;
}

.cell:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 0 0.3125rem rgba(0, 0, 0, 0.3);
}

.cell.wall {
    background-color: var(--text-color);
    border: 0.0625rem solid var(--bg-color);
    z-index: 1;
    cursor: not-allowed;
    box-shadow: inset 0 0 0.1875rem rgba(0, 0, 0, 0.5);
}

.cell.start {
    background-color: var(--primary-color);
    border: 0.125rem solid var(--secondary-color);
    z-index: 5;
    box-shadow: 0 0 0.625rem rgba(var(--primary-color-rgb), 0.7);
}

.cell.end {
    background-color: var(--error-color);
    border: 0.125rem solid #b91c1c;
    z-index: 5;
    box-shadow: 0 0 0.625rem rgba(239, 68, 68, 0.7);
}

.cell.path {
    background-color: var(--success-color);
    border: 0.0625rem solid #059669;
    z-index: 3;
    box-shadow: 0 0 0.3125rem rgba(16, 185, 129, 0.6);
}

.cell.visited {
    background-color: var(--visited-color);
    z-index: 2;
}

.maze-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    width: 100%;
}

.maze-button, .maze-select {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.maze-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    transition: background-color 0.2s;
}

.maze-button:hover {
    background-color: var(--secondary-color);
}

.maze-select {
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
}

.legend {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.color-box {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.color-box.start { background-color: var(--primary-color); }
.color-box.end { background-color: var(--error-color); }
.color-box.wall { background-color: var(--text-color); }
.color-box.path { background-color: var(--success-color); }

.maze-instructions {
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
}

.algorithm-instructions {
    font-size: 14px;
    color: var(--primary-color);
    font-style: italic;
    margin-left: 5px;
    animation: pulse 2s infinite;
}

.algorithm-explanation {
    max-width: 600px;
    margin: 20px auto;
    padding: 15px;
    background-color: var(--accent-color);
    border-left: 5px solid var(--primary-color);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.wall-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff9800;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Cards */
.card {
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

/* Grid layouts */
.grid {
    display: grid;
    gap: 1rem;
}

.about-grid, .research-grid, .project-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* About Section */
.about-grid {
    max-width: 75%;
    margin: 0 auto;
}

.about-text {
    font-size: 0.7125rem;
}

.expertise-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.tag {
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: 0.225rem 0.45rem;
    border-radius: 1rem;
    font-size: 0.6rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Research Section */
.research-grid {
    max-width: 75%;
    margin: 0 auto;
}

.research-card {
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: transform 0.3s ease;
}

.research-card:hover {
    transform: translateY(-5px);
}

.research-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Projects Section */
.project-grid {
    max-width: 75%;
    margin: 0 auto;
}

.project-card {
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease;
    padding: 0.75rem;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Contact Section */
.contact {
    background-color: var(--accent-color);
    padding: var(--spacing-unit) 0;
    text-align: center;
    position: relative;
}

.contact-content {
    max-width: 75%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.contact h2 {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

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

.contact-text p {
    font-size: 0.7125rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    opacity: 0.9;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.675rem;
    color: var(--text-color);
    opacity: 0.9;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.contact-button {
    display: inline-block;
    padding: 0.5625rem 1.125rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 2rem;
    text-decoration: none;
    font-size: 0.675rem;
    transition: background-color 0.2s;
}

.contact-button:hover {
    background-color: var(--secondary-color);
}

/* Utility classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }

/* States */
.cell.wall { 
    background-color: var(--text-color); 
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.cell.start { background-color: var(--primary-color); }
.cell.end { background-color: #ef4444; }
.cell.path { background-color: #10b981; }
.cell.visited { background-color: rgba(59, 130, 246, 0.2); }

/* Transitions */
* {
    transition: background-color 0.2s, color 0.2s;
}

/* Footer */
footer {
    background-color: var(--accent-color);
    padding: 1rem 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 48rem) {
    .container {
        width: 90%;
        max-width: 90%;
    }
    
    .project-detail:not(#maze) > .container {
        width: 95%;
        max-width: 95%;
    }
    
    .project-demo {
        width: 95%;
        max-width: 95%;
        min-height: 50rem;
        height: calc(100vh - 9.375rem);
    }
    
    .nav-links {
        display: none;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

.blog-index {
    max-width: 75%;
    margin: 0 auto;
}

.blog-post {
    margin-bottom: 5px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.blog-post h2 {
    font-size: 0.825rem;
    margin-bottom: 0.15rem;
}

.blog-post .post-meta {
    font-size: 0.5625rem;
    color: #555;
    margin-bottom: 0.15rem;
}

.blog-post p {
    font-size: 0.6375rem;
    line-height: 1.1;
    color: #333;
}

.blog-post a {
    text-decoration: none;
    color: #007BFF;
}

.blog-post a:hover {
    text-decoration: underline;
}

header {
    padding-left: 20px; /* Add more room on the left for the header */
}

/* Project Detail Base Styles */
.project-detail {
    padding-top: calc(var(--header-height) + 2rem);
    background-color: var(--bg-color);
    width: 100%;
    overflow-x: hidden;
}

/* Project Container - excluding maze */
.project-detail:not(#maze) > .container {
    max-width: 75%;
    width: 75%;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* Project Title */
.project-detail h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary-color);
    padding-top: 1rem;
}

/* Project Description */
.project-description {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.project-description p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-align: center;
}

.project-description h2 {
    text-align: center;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Project Lists */
.project-description ul {
    list-style: none;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

.project-description ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    font-size: 0.875rem;
}

.project-description ul li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-size: 1.2em;
}

/* Project Demo - for iframe-based projects */
.project-demo {
    margin: 2rem auto;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 75%;
    background-color: var(--bg-color);
    min-height: 1200px;
    height: calc(100vh - 200px);
}

.streamlit-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Maze-specific styles - kept separate */
#maze.maze {
    padding-top: 3rem;
    padding-bottom: 2rem;
    margin-top: 3rem;
}

#maze .container {
    max-width: 75%;
    width: 75%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Project Title - specific to maze page */
#maze.maze h1 {
    padding-top: 2rem;
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* General project container */
    .project-detail:not(#maze) > .container {
        width: 95%;
        max-width: 95%;
    }
    
    /* Project demo iframe */
    .project-demo {
        width: 95%;
        max-width: 95%;
        min-height: 800px;
        height: calc(100vh - 150px);
    }
    
    /* Project description */
    .project-description {
        padding: 0 0.5rem;
    }
    
    .project-description ul li {
        font-size: 0.8125rem;
    }
    
    /* Maze-specific responsive */
    #maze .container {
        width: 95%;
        max-width: 95%;
    }
} 