:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --accent-color: #06b6d4;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--secondary-color);
    color: white;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Header margin only for about page */
#about .header {
    margin-top: 70px;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1.5" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.1;
}

.header-content {
    position: relative;
    z-index: 1;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 30px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.025em;
}

.header .title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    opacity: 0.9;
    font-weight: 300;
}

.header .location {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Page Content */
.page-content {
    display: none;
    padding: 80px 0;
}

.page-content.active {
    display: block;
}

/* Home page specific padding */
#home {
    padding-top: 140px;
}

.section {
    margin-bottom: 80px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 2px;
}

/* Home Page Styles */
.hero-summary {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.highlight-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.highlight-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.highlight-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.highlight-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 60px 0;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: block;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Timeline Styles */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--secondary-color), var(--accent-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 80px;
}

.timeline-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
}

.timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.timeline-date {
    background: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

.timeline-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.timeline-subtitle {
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 15px;
}

.timeline-description {
    color: var(--text-muted);
    line-height: 1.6;
}

.timeline-description ul {
    margin: 15px 0;
    padding-left: 20px;
}

.timeline-description li {
    margin-bottom: 8px;
}

.timeline-marker {
    position: absolute;
    left: 22px;
    top: 30px;
    width: 16px;
    height: 16px;
    background: var(--secondary-color);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--secondary-color);
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.skill-category {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.skill-category h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Certifications */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.cert-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.cert-card:hover {
    transform: translateX(5px);
    box-shadow: var(--hover-shadow);
}

.cert-card h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.cert-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Notes Page Styles */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.note-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.note-header {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    padding: 20px;
}

.note-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.note-subtitle {
    opacity: 0.9;
    font-size: 0.9rem;
}

.note-content {
    padding: 20px;
}

.note-description {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
}

.note-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.note-link:hover {
    color: var(--primary-color);
}

/* Reinforcement Learning Page */
.rl-content {
    max-width: 1000px;
    margin: 0 auto;
}

.rl-intro {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    margin-bottom: 40px;
}

.rl-intro h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.rl-intro p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.concept-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.concept-card:hover {
    transform: translateX(5px);
    box-shadow: var(--hover-shadow);
}

.concept-card h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.concept-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
}

.concept-card ul {
    color: var(--text-muted);
    margin-left: 20px;
}

.concept-card li {
    margin-bottom: 8px;
}

/* Algorithm Section */
.algorithm-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

.algorithm-section h3 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.algorithm-section h4 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin: 25px 0 15px 0;
}

.algorithm-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 15px;
}

.algorithm-section ul {
    color: var(--text-muted);
    margin: 15px 0 15px 20px;
}

.algorithm-section li {
    margin-bottom: 8px;
}

.algorithm-section ol {
    color: var(--text-muted);
    margin: 15px 0 15px 20px;
}

.algorithm-section ol li {
    margin-bottom: 8px;
}

.algorithm-section ol ul {
    margin: 10px 0 10px 20px;
}

.algorithm-section ol ul li {
    margin-bottom: 5px;
}

.formula {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

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

/* Links Page Table-Style Layout */
.links-grid {
    display: block;
    margin: 25px 0;
}

.link-card {
    background: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 2px;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
    border-left-color: var(--secondary-color);
}

.link-card-content {
    display: grid;
    grid-template-columns: 300px 1fr auto;
    align-items: start;
    padding: 20px;
    gap: 20px;
    min-height: 60px;
}

.link-card h4 {
    margin: 0;
    padding: 0;
    grid-column: 1;
}

.link-card h4 a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
    display: block;
}

.link-card h4 a:hover {
    color: var(--secondary-color);
}

.link-card h4 a::after {
    content: " ↗";
    font-size: 0.9rem;
    opacity: 0.6;
    margin-left: 4px;
}

.link-description {
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    font-size: 0.95rem;
    grid-column: 2;
    padding-top: 2px;
}

.link-category {
    display: inline-flex;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    grid-column: 3;
    align-self: center;
    justify-self: end;
    white-space: nowrap;
}

/* Table Header */
.links-table-header {
    display: grid;
    grid-template-columns: 300px 1fr auto;
    gap: 20px;
    padding: 15px 20px;
    background: var(--background-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    border-radius: 8px;
}

/* Utility Links Table Style */
.utility-links {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.utility-links li {
    margin-bottom: 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

.utility-links li:last-child {
    border-bottom: none;
}

.utility-link-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    padding: 15px 20px;
    align-items: center;
    transition: background-color 0.2s ease;
}

.utility-link-content:hover {
    background-color: #f8fafc;
}

.utility-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: block;
    margin: 0;
}

.utility-links a:hover {
    color: var(--primary-color);
    transform: none;
}

.utility-links a::before {
    content: "→ ";
    margin-right: 5px;
    opacity: 0.7;
}

.utility-link-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Hover effects */
.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.link-card:hover::before {
    transform: scaleX(1);
}

/* Responsive Design */
@media (max-width: 968px) {
    .link-card-content,
    .links-table-header {
        grid-template-columns: 250px 1fr auto;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 50px;
        transition: left 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .header {
        margin-top: 70px;
        padding: 80px 0 60px;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .header .title {
        font-size: 1.2rem;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .section-title {
        font-size: 2rem;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        padding-left: 60px;
    }

    .timeline-marker {
        left: 12px;
    }

    .highlights {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-text {
        font-size: 1.1rem;
    }

    .timeline-content {
        padding: 20px;
    }

    .timeline-title {
        font-size: 1.2rem;
    }

    .link-card-content {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .link-description {
        grid-column: 1;
        padding-top: 8px;
    }
    
    .link-category {
        grid-column: 1;
        justify-self: start;
        margin-top: 8px;
    }
    
    .links-table-header {
        display: none;
    }
    
    .utility-link-content {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .utility-link-desc {
        padding-left: 20px;
        font-size: 0.85rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}