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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --accent-color: #0ea5e9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeIn 0.6s ease-in;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 2rem;
    position: relative;
    overflow: visible;
}

.download-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(37, 99, 235, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.download-btn:hover:not(:disabled) {
    background: rgba(37, 99, 235, 1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.download-btn i {
    font-size: 1rem;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.profile-section {
    display: flex;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.profile-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-image img {
    width: 120%;
    height: 120%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.3s ease;
    transform: scale(0.85);
}

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

.profile-info {
    flex: 1;
}

.name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.title {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.95rem;
}

.contact-info a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
    opacity: 0.9;
}

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

.contact-info i {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    padding: 3rem 2rem;
}

.section {
    margin-bottom: 3rem;
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
}

.section-title i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 900px;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 2rem;
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.timeline-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 1.5rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.timeline-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-item .company {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.timeline-item .date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-style: italic;
}

.timeline-item .description {
    color: var(--text-secondary);
    line-height: 1.7;
}

.timeline-item .description ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.timeline-item .description li {
    margin-bottom: 0.5rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

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

.project-card:hover::before {
    transform: scaleY(1);
}

.project-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-card h3 i {
    color: var(--primary-color);
    font-size: 1rem;
}

.project-card .project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-card .project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tech span {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-card .project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.project-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Skills Container */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.skill-category h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

.skill-tag {
    background: white;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Certifications */
.certifications-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.certification-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certification-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.certification-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.certification-item .issuer {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.certification-item .date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

/* Languages */
.languages-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Hobbies */
.hobbies-list {
    margin-top: 0.5rem;
}

.hobbies-list .skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hobbies-list .skill-tag {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

.hobbies-list .skill-tag:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .container {
        border-radius: 12px;
    }

    .header {
        padding: 1.5rem 1rem 2rem 1rem;
        padding-top: 4rem; /* Add top padding to prevent overlap with fixed button */
    }

    .download-btn {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .download-btn i {
        font-size: 0.9rem;
    }

    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .name {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }

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

    .contact-info {
        justify-content: center;
        flex-direction: column;
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    .contact-info a {
        justify-content: center;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .section {
        margin-bottom: 2rem;
    }

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

    .about-text {
        font-size: 1rem;
        line-height: 1.7;
    }

    .timeline {
        padding-left: 1.25rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .timeline-item h3 {
        font-size: 1.1rem;
    }

    .timeline-item .company {
        font-size: 0.95rem;
    }

    .timeline-item .date {
        font-size: 0.85rem;
    }

    .projects-grid,
    .skills-container,
    .certifications-list,
    .languages-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .project-card {
        padding: 1.25rem;
    }

    .project-card h3 {
        font-size: 1.1rem;
    }

    .project-card .project-description {
        font-size: 0.95rem;
    }

    .project-tech span {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }

    .skill-category {
        padding: 1.25rem;
    }

    .certification-item {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.25rem;
    }

    .header {
        padding-top: 3.5rem;
        padding: 1rem 0.75rem 1.5rem 0.75rem;
    }

    .download-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.85rem;
        font-size: 0.75rem;
    }

    .download-btn i {
        font-size: 0.8rem;
        margin-right: 0.25rem;
    }

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

    .name {
        font-size: 1.5rem;
    }

    .title {
        font-size: 1rem;
    }

    .contact-info {
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .main-content {
        padding: 1.25rem 0.75rem;
    }

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

    .about-text {
        font-size: 0.95rem;
    }
}

@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
        max-width: 100%;
    }

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

    .download-btn {
        display: none;
    }

    .header {
        page-break-after: avoid;
    }

    .main-content {
        padding: 2rem 1.5rem;
    }

    @page {
        margin: 0.5in;
    }
}
