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

body {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: #1a1a1a;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    background: #ffffff;
}

header {
    margin-bottom: 30px;
    padding-bottom: 5px;
    border-bottom: 3px solid #2563eb;
    position: relative;
}

header h1 {
    font-size: 2.2em;
    font-weight: normal;
    margin-bottom: 5px;
    color: #1a1a1a;
}

header p {
    color: #666;
    font-size: 1.05em;
    font-style: italic;
}

/* Add a subtle accent line that extends on hover */
header:before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

header:hover:before {
    width: 150px;
}

nav {
    margin: 10px 0 0 0;
    padding: 10px 0 0 0;
}

nav a {
    margin-right: 25px;
    text-decoration: none;
    color: #2563eb;
    font-size: 0.95em;
    position: relative;
    transition: color 0.2s ease;
}

/* Underline animation on hover */
nav a:after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: #2563eb;
    transition: width 0.3s ease;
}

nav a:hover:after {
    width: 100%;
}

nav a:hover {
    color: #1d4ed8;
}

/* Active page indicator */
nav a.active {
    color: #1d4ed8;
    font-weight: 600;
}

nav a.active:after {
    width: 100%;
}

section {
    margin: 50px 0;
}

section h2 {
    font-size: 1.6em;
    font-weight: normal;
    margin-bottom: 20px;
    color: #1a1a1a;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    position: relative;
}

/* Accent marker for section headers */
section h2:before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 50px;
    height: 2px;
    background: #2563eb;
}

/* Data visualization styles */
.data-visualization {
    margin: 40px 0;
    padding: 30px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.data-visualization h3 {
    font-size: 1.3em;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 600;
}

.data-visualization > p {
    color: #64748b;
    font-size: 0.95em;
    margin-bottom: 25px;
    font-style: italic;
}

.data-visualization canvas {
    max-width: 100%;
    height: auto !important;
}

/* Chart controls */
.chart-controls {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    padding: 20px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.9em;
    font-weight: 600;
    color: #1a1a1a;
}

.control-group select {
    padding: 8px 12px;
    font-family: 'Georgia', serif;
    font-size: 0.95em;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    background: white;
    color: #1a1a1a;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.control-group select:hover {
    border-color: #2563eb;
}

.control-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e5e7eb 0%, #2563eb 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #64748b;
    margin-top: -5px;
}

@media (max-width: 600px) {
    .chart-controls {
        flex-direction: column;
        gap: 20px;
    }
}

#publications .publication-list {
    list-style: none;
    margin-left: 0;
}

#publications .publication-item {
    margin: 30px 0;
    padding: 20px;
    position: relative;
    border-left: 3px solid #e5e7eb;
    transition: all 0.3s ease;
    background: #fafafa;
}

#publications .publication-item:hover {
    border-left-color: #2563eb;
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.publication-content {
    position: relative;
}

.publication-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
}

.publication-authors {
    color: #475569;
    font-size: 0.95em;
    margin-bottom: 5px;
}

.publication-authors strong {
    color: #1a1a1a;
}

.publication-info {
    color: #64748b;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.abstract-toggle {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.85em;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 5px;
}

.abstract-toggle:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.abstract-toggle:active {
    transform: translateY(0);
}

.abstract-toggle.active {
    background: #1e40af;
}

.abstract {
    margin-top: 15px;
    padding: 15px;
    background: #ffffff;
    border-left: 3px solid #93c5fd;
    border-radius: 4px;
    color: #334155;
    font-size: 0.95em;
    line-height: 1.7;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Projects section styles */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 30px;
}

.project-card {
    display: block;
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #e5e7eb;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 20px;
}

.project-content h3 {
    font-size: 1.15em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.project-card:hover .project-content h3 {
    color: #2563eb;
}

.project-content p {
    color: #475569;
    font-size: 0.9em;
    line-height: 1.6;
    margin: 0;
}

/* Project cards with modals */
.project-card[data-modal] {
    cursor: pointer;
}

/* Responsive design for projects */
@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    color: #64748b;
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    padding: 15px 20px;
    background: white;
    border-radius: 0 8px 0 0;
    z-index: 1;
    transition: color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #2563eb;
}

.modal-content h2 {
    font-size: 1.8em;
    color: #1a1a1a;
    padding: 20px 30px 10px;
    margin: 0;
    border-bottom: 2px solid #e5e7eb;
}

.modal-body {
    padding: 30px;
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 25px;
}

.modal-body h3 {
    font-size: 1.3em;
    color: #1a1a1a;
    margin-top: 25px;
    margin-bottom: 12px;
    border-left: 4px solid #2563eb;
    padding-left: 15px;
}

.modal-body p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 15px;
}

.modal-body ul {
    color: #475569;
    line-height: 1.7;
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-body li {
    margin-bottom: 8px;
}

/* Smooth scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 8px 8px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Teaching section styles */
.teaching-item {
    margin: 25px 0;
    padding: 20px;
    background: #fafafa;
    border-left: 3px solid #2563eb;
    transition: all 0.3s ease;
}

.teaching-item:hover {
    background: #f9fafb;
    padding-left: 25px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.teaching-item h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.teaching-role {
    color: #2563eb;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 10px;
}

.teaching-item p {
    color: #475569;
    line-height: 1.6;
}

/* Awards section styles */
.awards-list {
    list-style: none;
    margin-left: 0;
}

.awards-list li {
    margin: 20px 0;
}

.award-item {
    display: flex;
    gap: 20px;
    padding: 18px;
    background: #fafafa;
    border-radius: 4px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.award-item:hover {
    background: #f9fafb;
    border-left-color: #2563eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transform: translateX(3px);
}

.award-year {
    font-size: 1.1em;
    font-weight: 600;
    color: #2563eb;
    min-width: 60px;
    flex-shrink: 0;
}

.award-content {
    flex: 1;
}

.award-content strong {
    font-size: 1em;
    color: #1a1a1a;
    display: block;
    margin-bottom: 5px;
}

.award-content p {
    color: #475569;
    font-size: 0.95em;
    margin: 0;
    line-height: 1.6;
}

/* Add subtle box for contact section */
#contact {
    background: #f8fafc;
    padding: 30px;
    border-radius: 4px;
    border-left: 4px solid #2563eb;
}

#contact p {
    color: #475569;
}

/* Interactive Model Interface */
.model-interface {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.model-form {
    background: #fafafa;
    padding: 30px;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.model-form h3 {
    font-size: 1.2em;
    color: #1a1a1a;
    margin-bottom: 20px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9em;
    font-weight: 600;
    color: #1a1a1a;
}

.form-group input[type="number"],
.form-group select {
    padding: 10px 12px;
    font-family: 'Georgia', serif;
    font-size: 0.95em;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    background: white;
    color: #1a1a1a;
    transition: border-color 0.2s ease;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* JSON List Editor */
.json-list-editor {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e5e7eb;
}

.editor-description {
    font-size: 0.9em;
    color: #64748b;
    margin-bottom: 20px;
    font-style: italic;
}

#jsonListItems {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.json-list-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.json-list-item:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.json-item-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
}

.json-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.json-field label {
    font-size: 0.8em;
    font-weight: 600;
    color: #475569;
}

.json-field input {
    padding: 8px 10px;
    font-family: 'Georgia', serif;
    font-size: 0.9em;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: white;
    color: #1a1a1a;
    transition: border-color 0.2s ease;
}

.json-field input:focus {
    outline: none;
    border-color: #2563eb;
}

.add-item-btn {
    padding: 10px 20px;
    background: white;
    color: #2563eb;
    border: 2px solid #2563eb;
    border-radius: 4px;
    font-family: 'Georgia', serif;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-item-btn:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.remove-item-btn {
    padding: 8px 16px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Georgia', serif;
    font-size: 0.85em;
    cursor: pointer;
    white-space: nowrap;
    align-self: center;
    transition: all 0.2s ease;
}

.remove-item-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

/* Run Model Button */
.run-model-btn {
    width: 100%;
    padding: 14px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Georgia', serif;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.run-model-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.run-model-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Spinner animation */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error message */
.model-error {
    margin-top: 20px;
    padding: 15px;
    background: #fee;
    border: 1px solid #dc2626;
    border-radius: 4px;
    color: #991b1b;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Results display */
.model-results {
    background: #fafafa;
    padding: 30px;
    border-radius: 8px;
    border-left: 4px solid #16a34a;
}

.model-results h3 {
    font-size: 1.2em;
    color: #1a1a1a;
    margin-bottom: 20px;
    font-weight: 600;
}

.results-summary {
    margin-bottom: 30px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-label {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 500;
}

.summary-value {
    font-size: 1.1em;
    color: #1a1a1a;
    font-weight: 600;
}

#resultsChart {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 6px;
}

/* Responsive design for model interface */
@media (max-width: 900px) {
    .model-interface {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .json-item-fields {
        grid-template-columns: 1fr;
    }

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