/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

h1 {
    font-size: 2.2rem;
    font-weight: normal;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* Sections */
section {
    margin-bottom: 2.5rem;
}

h2 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.3rem;
}

p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Publications */
.publications {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.publication {
    border: 1px solid #e0e0e0;
    padding: 1.2rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.publication h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
}

.publication .details {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.8rem;
}

.publication .description {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.download-btn {
    display: inline-block;
    background-color: #2c3e50;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 3px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #34495e;
}

/* Projects */
.projects {
    margin-bottom: 2rem;
}

.project {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #fdfdfd;
    transition: box-shadow 0.3s ease;
    margin-bottom: 2rem;
}

.project:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project.upcoming {
    opacity: 0.8;
    background-color: #f9f9f9;
}

.project-content {
    /* Simplified layout using floats for maximum Safari compatibility */
    overflow: hidden;
}

.project-media {
    float: left;
    width: 30%;
    margin-right: 3%;
    margin-bottom: 1rem;
}

.project-details {
    float: right;
    width: 67%;
}

/* Clear floats after project content */
.project-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Safari fallback for project-media gap */
.project-media > *:not(:last-child) {
    margin-bottom: 0.8rem;
}

.project-screenshot {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #ddd;
    object-fit: cover;
    max-height: 200px;
}

.project-media.placeholder {
    text-align: center;
    min-height: 150px;
    padding-top: 2rem;
}

.coming-soon {
    text-align: center;
    color: #666;
    background-color: #f0f0f0;
    padding: 2rem;
    border-radius: 6px;
    border: 2px dashed #ccc;
}

.coming-soon span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.project-status {
    margin-top: 0.8rem;
}

.project-status > * {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.status-badge, .tech-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge {
    background-color: #2c3e50;
    color: white;
}

.status-badge.upcoming {
    background-color: #f39c12;
}

.tech-badge {
    background-color: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
}

.project-details h3 {
    margin-bottom: 0.8rem;
    color: #2c3e50;
}

.project-description {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.future-plans {
    background-color: #e8f4f8;
    padding: 1rem;
    border-left: 3px solid #3498db;
    border-radius: 0 4px 4px 0;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.project-links {
    margin-top: 1rem;
}

.project-links > * {
    display: inline-block;
    margin-right: 0.8rem;
    margin-bottom: 0.5rem;
}

.project-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid;
}

.github-btn {
    background-color: #24292e;
    color: white;
    border-color: #24292e;
}

.github-btn:hover {
    background-color: #1c1f23;
}

.play-btn {
    background-color: #2c3e50; /* change it to the blue of the website */
    color: white;
    border-color: #2c3e50;
}

.play-btn:hover {
    background-color: #2980b9;
}

/* Contact */
.contact {
    background-color: #f9f9f9;
    padding: 1.2rem;
    border-left: 3px solid #2c3e50;
    border-radius: 0 4px 4px 0;
}

.contact p {
    margin-bottom: 0.5rem;
}

.contact a {
    color: #2c3e50;
    text-decoration: none;
}

.contact a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .publications {
        grid-template-columns: 1fr;
    }
    
    /* Mobile layout for projects */
    .project-media {
        float: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .project-details {
        float: none;
        width: 100%;
    }
    
    .project-links {
        text-align: center;
    }
}