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

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #4a4a4a;
    --accent-color: #2563eb;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --background: #ffffff;
    --max-width: 800px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--primary-color);
    background: var(--background);
    padding: 2rem 1rem;
}

/* Container */
.cv-container {
    max-width: var(--max-width);
    margin: 0 auto;
    background: white;
}

/* Header */
.cv-header {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 3rem;
}

.cv-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--text-light);
}

.contact-info span {
    position: relative;
}

.contact-info span:not(:last-child)::after {
    content: "•";
    position: absolute;
    right: -0.6rem;
    color: var(--border-color);
}

.contact-info a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.contact-info a:hover {
    opacity: 0.7;
}

/* Sections */
.cv-section {
    margin-bottom: 3rem;
}

.cv-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cv-section p {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

/* Experience Items */
.experience-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.experience-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.company {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

.period {
    font-size: 0.9rem;
    color: var(--text-light);
    white-space: nowrap;
}

.technologies {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.9rem;
    color: var(--text-light);
}

.experience-item ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.experience-item li {
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

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

.skill-category {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 4px;
}

.skill-category strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.skill-category p {
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin: 0;
}

/* Education */
.education-item {
    margin-bottom: 1rem;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.education-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.institution {
    color: var(--text-light);
    font-weight: 500;
}

/* Projects */
.project-item {
    margin-bottom: 1.5rem;
}

.project-item:last-child {
    margin-bottom: 0;
}

.project-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-item h3 a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.project-item h3 a:hover {
    opacity: 0.7;
}

/* Languages List */
.languages-list {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.languages-list li {
    color: var(--secondary-color);
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 640px) {
    .cv-header h1 {
        font-size: 2rem;
    }

    .contact-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .contact-info span:not(:last-child)::after {
        content: none;
    }

    .experience-header,
    .education-header {
        flex-direction: column;
    }

    .period {
        white-space: normal;
    }

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

    .languages-list {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media print {
    body {
        padding: 0;
    }

    .cv-container {
        max-width: 100%;
    }

    a {
        color: var(--primary-color);
        text-decoration: none;
    }

    .experience-item,
    .cv-section {
        page-break-inside: avoid;
    }
}
