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

:root {
    --bg-color: #ffffff;
    --text-color: #2c3e50;
    --link-color: #39c5bb;
    --link-hover: #66ccff;
    --border-color: #e0e0e0;
    --accent-color: #34495e;
    --light-gray: #f8f9fa;
    --font-serif: 'Crimson Text', Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding: 20px;
}

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

/* Header and Profile Section */
header {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.profile-section {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.profile-image {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.profile-image img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

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

.visitor-map {
    width: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.visitor-map #clustrmaps {
    max-width: 100%;
}

.profile-info h1 {
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent-color);
}

.subtitle {
    font-size: 1.2em;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.bio {
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 20px;
    text-align: justify;
}

.highlight {
    background-color: #fff3cd;
    padding: 12px 16px;
    border-left: 4px solid #ffc107;
    margin: 20px 0;
    font-size: 0.95em;
}

.contact-links {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.contact-links a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9em;
    padding: 8px 16px;
    border: 1px solid var(--link-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.contact-links a:hover {
    background-color: var(--link-color);
    color: white;
    transform: translateY(-2px);
}

/* Navigation */
nav {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1em;
    position: relative;
    transition: color 0.3s ease;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--link-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Section Styles */
section {
    margin-bottom: 60px;
}

section h2 {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--accent-color);
    position: relative;
    padding-bottom: 10px;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--link-color);
}

/* News Section */
.news-item {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

.news-item .date {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--link-color);
    min-width: 100px;
}

.news-item .content {
    flex: 1;
}

/* Publications Section */
.publication {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.publication:last-child {
    border-bottom: none;
}

.pub-year {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--link-color);
    font-size: 1.1em;
    min-width: 70px;
}

.pub-content h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
}

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

.pub-content h3 a:hover {
    color: var(--link-color);
}

.pub-authors {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.pub-venue {
    font-size: 0.85em;
    color: var(--link-color);
    font-style: italic;
}

/* Education Section */
.education-item {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.edu-year {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--link-color);
    min-width: 120px;
}

.edu-content h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--accent-color);
}

.edu-content p {
    font-size: 0.95em;
    color: #666;
}

/* Professional Services Section */
.service-item {
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.service-item:nth-child(2) { animation-delay: 0.1s; }
.service-item:nth-child(3) { animation-delay: 0.2s; }

.service-item p {
    font-size: 1em;
    line-height: 1.8;
}

/* Contact Section */
#contact p {
    font-size: 1em;
    margin-bottom: 20px;
}

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

#contact a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.visitor-badge {
    margin-top: 20px;
}

/* Footer */
footer {
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: #7f8c8d;
    font-size: 0.85em;
}

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

/* Stagger animation delays */
.news-item:nth-child(1) { animation-delay: 0.1s; }
.news-item:nth-child(2) { animation-delay: 0.2s; }
.news-item:nth-child(3) { animation-delay: 0.3s; }

.publication:nth-child(1) { animation-delay: 0.1s; }
.publication:nth-child(2) { animation-delay: 0.2s; }
.publication:nth-child(3) { animation-delay: 0.3s; }
.publication:nth-child(4) { animation-delay: 0.4s; }
.publication:nth-child(5) { animation-delay: 0.5s; }

.education-item:nth-child(1) { animation-delay: 0.1s; }
.education-item:nth-child(2) { animation-delay: 0.2s; }
.education-item:nth-child(3) { animation-delay: 0.3s; }

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 10px;
    }

    .container {
        padding: 20px 10px;
    }

    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-image img {
        width: 150px;
        height: 150px;
    }

    .profile-info h1 {
        font-size: 2em;
    }

    .contact-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }

    .publication,
    .education-item,
    .news-item {
        flex-direction: column;
        gap: 10px;
    }

    .pub-year,
    .edu-year,
    .news-item .date {
        min-width: auto;
    }

    section h2 {
        font-size: 1.6em;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 12px;
    }

    .profile-info h1 {
        font-size: 1.8em;
    }

    .contact-links a {
        font-size: 0.85em;
        padding: 6px 12px;
    }
}

/* Misc Section */
.misc-content {
    position: relative;
}

.hobbies-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.hobbies-list li {
    font-size: 1.1em;
    padding: 10px 0;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.hobbies-list li:nth-child(1) { animation-delay: 0.1s; }
.hobbies-list li:nth-child(2) { animation-delay: 0.2s; }
.hobbies-list li:nth-child(3) { animation-delay: 0.3s; }

.secret-button {
    background: rgba(57, 197, 187, 0.3);
    border: 1px solid #39c5bb;
    color: #39c5bb;
    cursor: pointer;
    font-size: 10px;
    padding: 8px 16px;
    margin-top: 20px;
    position: absolute;
    bottom: 0;
    right: 0;
    opacity: 0.05;
    pointer-events: auto;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.secret-button:hover {
    background: rgba(57, 197, 187, 0.5);
    transform: scale(1.05);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s ease;
}

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

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--accent-color);
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    font-family: var(--font-serif);
}

.modal-content button {
    background-color: var(--link-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.modal-content button:hover {
    background-color: var(--link-hover);
}

.close, .close-image {
    color: #aaa;
    float: right;
    font-size: 21px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover, .close-image:hover {
    color: #000;
}

.error-msg {
    color: #39c5bb;
    margin-top: 10px;
    font-size: 0.9em;
    font-weight: 600;
}

#imageModal .modal-content {
    padding: 20px;
    text-align: center;
    max-width: 700px;
}

.image-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#secretImage {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* Leaderboard Styles */
.leaderboard-section {
    margin-top: 20px;
    text-align: left;
}

.leaderboard-section h3 {
    color: #39c5bb;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
}

.leaderboard-section h4 {
    color: var(--accent-color);
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: center;
}

.name-input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.name-input-section input {
    flex: 1;
    max-width: 300px;
    padding: 10px;
    border: 2px solid #39c5bb;
    border-radius: 4px;
    font-size: 1em;
    font-family: var(--font-serif);
}

.name-input-section button {
    background-color: #39c5bb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.name-input-section button:hover {
    background-color: #2da89f;
}

.leaderboard {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #39c5bb;
    transition: transform 0.2s ease;
}

.leaderboard-entry:hover {
    transform: translateX(5px);
}

.leaderboard-entry .rank {
    font-weight: 700;
    color: #39c5bb;
    min-width: 40px;
    font-size: 1.1em;
}

.leaderboard-entry .name {
    flex: 1;
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1em;
}

.leaderboard-entry .date {
    color: #7f8c8d;
    font-size: 0.85em;
}

.no-entries {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}

/* Print Styles */
@media print {
    body {
        font-size: 12pt;
        color: #000;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .nav-link,
    .contact-links,
    .visitor-badge {
        display: none;
    }

    section {
        page-break-inside: avoid;
    }
}