/* Base styles - Mobile First */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    background: #f8f9fa;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    min-width: 100%;
    position: relative;
}

.container {
    width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
    box-sizing: border-box;
    max-width: 100vw;
}

/* Header - Mobile First */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    padding: 2rem 0;
    margin: 0;
    position: relative;
    overflow: hidden;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.header-content {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

.profile-info {
    text-align: center;
    width: 100%;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.title {
    font-size: 1.1rem;
    margin-top: 0.8rem;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Profile photo pulse animation */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        transform: scale(1);
    }
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.4s ease;
}

.profile-photo:hover {
    animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .profile-photo:hover {
        animation: none;
        transform: scale(1.02);
    }
}

/* Sections - Mobile First */
section {
    margin-bottom: 1.5rem;
    background: #fff;
    padding: 1.5rem 0;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

section h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    position: relative;
    padding-bottom: 0.5rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    border-radius: 2px;
}

/* Skills Grid - Mobile First */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem;
}

.skill-category {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.skill-category h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(52, 152, 219, 0.2);
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.skill-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 1rem;
}

.skill-bar {
    height: 6px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    border-radius: 3px;
    transition: width 1s ease-in-out;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(46, 204, 113, 0.1) 100%);
    padding: 0.6rem 1rem;
    border-radius: 20px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* Tablet and Desktop Styles */
@media (min-width: 768px) {
    body {
        font-size: 16px;
    }

    .container {
        max-width: 1200px;
        padding: 0 2rem;
    }

    header {
        padding: 4rem 0;
    margin-bottom: 2rem;
    }

    .header-content {
        flex-direction: row;
        justify-content: center;
        gap: 4rem;
        max-width: 1000px;
    }

    .profile-info {
        text-align: left;
        max-width: 600px;
    }

    header h1 {
        font-size: 2.8rem;
    }

    .title {
        font-size: 1.3rem;
    }

    .profile-photo {
        width: 200px;
        height: 200px;
        border-width: 4px;
    }

    section {
        margin-bottom: 3rem;
        padding: 2.5rem 0;
        border-radius: 12px;
    }

    section h2 {
    font-size: 2rem;
        margin-bottom: 2.5rem;
    }

    section h2::after {
        width: 80px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2rem;
        padding: 1rem;
    }

    .skill-category {
        padding: 2rem;
    }

    .skill-category h3 {
        font-size: 1.4rem;
    }

    .skill-name {
        font-size: 1.1rem;
    }

    .skill-bar {
        height: 8px;
    }

    .skill-tag {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

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

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    header {
        background: none;
        color: black;
        padding: 1rem 0;
    }

    .profile-photo {
        width: 100px;
        height: 100px;
    }

    section {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 1rem;
        padding: 1rem 0;
        box-shadow: none;
    }

    .skill-bar {
        border: 1px solid #ccc;
    }

    .skill-level {
        background: #666;
    }

    .skill-tag {
        border: 1px solid #ccc;
        background: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .skill-level {
        background: #000;
    }

    .skill-tag {
        background: #fff;
        border: 2px solid #000;
    }
}

/* About section */
#about p {
    font-size: 1.1rem;
    line-height: 1.8;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

#about p span {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

#about p span:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

#about p span::before {
    content: attr(data-emoji);
    font-size: 1.5rem;
    min-width: 2rem;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Base font size for mobile */
    }

    header {
        padding: 2rem 0;
    }

    .header-content {
        flex-direction: column-reverse;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .profile-info {
        text-align: center;
        padding: 0 1rem;
    }

    header h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .profile-photo {
        width: 150px;
        height: 150px;
    }

    section {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
        border-radius: 0;
    }

    section h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    #about p {
        font-size: 1rem;
        line-height: 1.6;
        padding: 0.5rem;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    #about p span {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    #about p span::before {
        font-size: 1.3rem;
        min-width: 1.75rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }

    .skill-category {
        padding: 1.5rem;
    }

    .skill-category h3 {
        font-size: 1.2rem;
    }

    .skill-name {
        font-size: 1rem;
    }

    .skill-tag {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    /* Improve touch targets */
    .skill-tag,
    .publication-links a,
    .timeline-content h3,
    .education-item h4 {
        padding: 0.8rem;
        margin: 0.2rem;
        min-height: 44px; /* Minimum touch target size */
        display: flex;
        align-items: center;
    }

    /* Improve readability */
    .timeline-content,
    .education-content,
    .presentation-item {
        padding: 1rem;
        background: #fff;
        border-radius: 8px;
        margin-bottom: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* Add spacing between sections */
    section + section {
        margin-top: 2rem;
    }

    /* Improve scroll to top button */
    .scroll-to-top {
        width: 50px;
        height: 50px;
        bottom: 30px;
        right: 30px;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .title {
        font-size: 0.9rem;
    }

    #about p br {
        display: none; /* Remove line breaks on very small screens */
    }

    #about p {
        padding: 0.25rem;
        gap: 0.5rem;
    }

    #about p span {
        padding: 0.6rem;
        font-size: 0.95rem;
        border-radius: 8px;
    }

    #about p span::before {
        font-size: 1.2rem;
        min-width: 1.5rem;
    }

    .timeline-date {
        font-size: 0.9rem;
    }

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

    .education-item {
        margin-bottom: 1.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .skill-category:hover,
    .publication-item:hover,
    .education-item:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .profile-photo:hover {
        transform: none;
    }

    /* Improve tap feedback */
    .skill-tag:active,
    .publication-links a:active,
    .scroll-to-top:active {
        opacity: 0.7;
    }
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.scroll-to-top:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Core styles */
:root {
    --primary-color: #333;
    --secondary-color: #666;
    --background-color: #f5f5f5;
    --text-color: #333;
    --accent-color: #007bff;
}

/* Footer styles */
footer {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

/* Utility classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Presentations Section */
.presentations-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

/* Filter Controls */
.presentation-filters {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #2c3e50;
    font-size: 0.9rem;
    min-width: 150px;
}

.clear-filters-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #2c3e50;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    background: #e9ecef;
}

/* Stats Summary */
.presentation-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Presentation Types */
.presentation-type {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.presentation-type h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(52, 152, 219, 0.2);
}

.presentation-type h3 i {
    color: #3498db;
}

/* Presentation Items */
.presentation-items {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.presentation-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}

.presentation-item:hover {
    transform: translateY(-2px);
}

.presentation-item.filtered-out {
    display: none;
}

.presentation-item[style*="display: none"] {
    opacity: 0;
    transform: translateY(20px);
}

.presentation-item[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 2rem;
}

.no-results i {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.no-results p {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Show More Button */
.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease-in-out;
}

.show-more-btn:hover {
    background-color: #e9e9e9;
}

.show-more-btn i {
    transition: transform 0.3s ease-in-out;
}

.show-more-btn.active i {
    transform: rotate(180deg);
}

@media (min-width: 768px) {
    .presentations-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 767px) {
    .presentation-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    margin: 2rem 0;
}

.error-message p {
    color: #d32f2f;
    margin: 0;
    font-size: 1.1rem;
} 