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

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #4a6670;
    --accent-hover: #5a7880;
    --border: #333333;
    --max-width: 1200px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    color: var(--text-secondary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

blockquote {
    margin: 2rem 0;
    padding: 2rem 2rem 1.5rem 3rem;
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, 
        rgba(74, 102, 112, 0.15) 0%, 
        rgba(74, 102, 112, 0.08) 50%, 
        rgba(74, 102, 112, 0.05) 100%);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-primary);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(74, 102, 112, 0.2);
    border-bottom: 1px solid rgba(74, 102, 112, 0.2);
}

blockquote::before {
    /* Option 1: Classic straight quotes */
    /* content: '"'; */
    /* Option 2: Fancy curly quotes - uncomment to use */
    /* content: '"'; */
    /* Option 3: French guillemets - uncomment to use */
    /* content: '«'; */
    /* Option 4: Single curly quote - uncomment to use */
    /* content: '''; */
    /* Option 5: Double angle brackets - uncomment to use */
    /* content: '»'; */
    /* Option 6: Mathematical quote symbol - uncomment to use */
    content: '❝';
    
    font-size: 5rem;
    color: var(--accent);
    position: absolute;
    top: -0.8rem;
    left: 0.3rem;
    opacity: 0.4;
    line-height: 1;
    font-family: Georgia, serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

blockquote::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent) 20%, 
        var(--accent) 80%, 
        transparent 100%);
    opacity: 0.5;
}

blockquote p {
    margin-bottom: 0;
}

/* Header and Navigation */
.site-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 0.1em;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 300;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

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

.nav-links a:hover::before {
    width: 100%;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
}

.dropdown-menu a::before {
    display: none;
}

.dropdown-menu a:hover {
    background-color: var(--border);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-weight: 200;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Sections */
.section {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.section h2 {
    margin-bottom: 2rem;
}

/* Footer */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

.site-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .mobile-nav-toggle {
        display: block;
    }
    
    .main-nav {
        position: relative;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
        display: none;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    /* Content Adjustments */
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        padding: 2rem 0 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero {
        min-height: 40vh;
        padding: 3rem 1rem;
    }
    
    .hero-large {
        min-height: 60vh;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .content-section {
        padding: 0 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-form-container {
        padding: 0 1rem;
    }
    
    /* Notes Mobile Styles */
    .notes-header {
        padding: 2rem 0 1rem;
    }
    
    .notes-header h1 {
        font-size: 2rem;
    }
    
    .note-item {
        padding: 1.5rem 0;
    }
    
    .note-item h2 {
        font-size: 1.5rem;
    }
}

/* Animations */
.fade-target {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Active Navigation State */
.nav-links a.active {
    color: var(--text-primary);
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent);
}

/* Page Headers */
.page-header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 200;
}

/* Content Sections */
.content-section {
    max-width: 800px;
    margin: 0 auto;
}

.content-section h2 {
    margin-top: 3rem;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Hero Modifications */
.hero-large {
    min-height: 70vh;
}

.hero-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-weight: 400;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background-color: var(--accent);
    color: white;
}

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

.project-card {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

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

.project-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-link {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 500;
}

/* Notes/Blog Styles */
.notes-header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.notes-header h1 {
    font-size: 3rem;
    font-weight: 200;
    margin-bottom: 0.5rem;
}

.notes-list {
    max-width: 800px;
    margin: 0 auto;
}

.note-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.note-item:last-child {
    border-bottom: none;
}

.note-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.note-item h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.note-item h2 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.note-item h2 a:hover {
    color: var(--accent);
}

.note-item p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.read-more {
    font-weight: 500;
    display: inline-block;
    transition: transform 0.3s ease;
}

.read-more:hover {
    transform: translateX(4px);
}

/* Visualization Control */
#viz-control {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

#viz-toggle {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#viz-toggle:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#viz-menu {
    position: absolute;
    bottom: 50px;
    right: 0;
    min-width: 200px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

#viz-menu.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

#viz-menu label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

#viz-select {
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

#viz-select:focus {
    outline: none;
    border-color: var(--accent);
}

#viz-select option {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Validation Forms */
.validation-form {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.validation-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 400;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.button-group {
    display: flex;
    gap: 0.25rem;
}

.validation-form input {
    flex: 1;
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s ease;
}

.validation-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.validation-form input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.validation-result {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.validation-result.success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.validation-result.error {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.validation-success {
    color: #4caf50;
}

.validation-error {
    color: #f44336;
}

.validation-result small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.generate-btn {
    background-color: var(--accent);
    color: var(--text-primary);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.generate-btn:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

.generate-btn:active {
    transform: translateY(0);
}

.copy-btn {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background-color: var(--accent);
    color: var(--text-primary);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background-color: #4caf50;
    color: white;
    border-color: #4caf50;
}

/* Mobile adjustments for validation forms */
@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .button-group {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .generate-btn {
        flex: 1;
    }
    
    .copy-btn {
        min-width: 3rem;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #viz-control {
        bottom: 1rem;
        right: 1rem;
    }
    
    #viz-menu {
        min-width: 180px;
        right: -80px; /* Center better on mobile */
    }
}

/* Note Detail Pages */
.note-detail {
    max-width: 800px;
    margin: 0 auto;
}

.note-header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.note-content {
    line-height: 1.7;
}

.note-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.note-nav {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.back-link {
    font-weight: 500;
    transition: transform 0.3s ease;
}

.back-link:hover {
    transform: translateX(-4px);
}

/* Image Styles */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.note-content img {
    margin: 2rem 0;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
}

.note-content img:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Image Size Classes */
.large-image {
    width: 100%;
    margin: 3rem 0 !important;
}

.medium-image {
    max-width: 200px;
    margin: 2rem auto !important;
    display: block !important;
}

.small-image {
    max-width: 160px;
    margin: 1.5rem auto !important;
    display: block !important;
}

.inline-image {
    display: inline-block !important;
    margin: 0 0.5rem !important;
    vertical-align: middle;
    max-height: 1.5em;
}

.hero-image {
    max-width: 200px;
    margin: 0 auto 3rem auto !important;
    display: block !important;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Image Alignment */
.image-left {
    float: left;
    margin: 0 2rem 1rem 0 !important;
    max-width: 40%;
}

.image-right {
    float: right;
    margin: 0 0 1rem 2rem !important;
    max-width: 40%;
}

.image-center {
    display: block !important;
    margin: 2rem auto !important;
}

/* Image Captions */
.image-caption {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.note-content figure {
    margin: 2rem 0;
    text-align: center;
}

.note-content figure img {
    margin: 0 0 0.5rem 0;
}

.note-content figcaption {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Image Galleries */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.image-gallery img {
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.02);
}

/* Mobile Image Adjustments */
@media (max-width: 768px) {
    .note-content img {
        margin: 1.5rem 0;
    }
    
    .large-image,
    .medium-image,
    .small-image {
        margin: 1.5rem 0 !important;
    }
    
    .hero-image {
        margin: 0 0 2rem 0 !important;
        border-radius: 6px;
    }
    
    .image-left,
    .image-right {
        float: none;
        margin: 1.5rem 0 !important;
        max-width: 100%;
        display: block;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .note-content figcaption {
        padding: 0 1rem;
    }
}

/* Utility Classes */
.hidden {
    opacity: 0;
    visibility: hidden;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
