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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #334155;
    background-color: #f8fafc;
}

.container {
    min-height: 100vh;
    padding: 2rem 1rem;
}

.cv-wrapper {
    max-width: 64rem;
    margin: 0 auto;
    background: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

/* Export Button */
.export-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: #0f172a;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
    font-size: 0.875rem;
    font-weight: 500;
}

.export-btn:hover {
    background: #1e293b;
}

.export-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.export-btn .icon {
    width: 1rem;
    height: 1rem;
}

/* Header */
.header {
    background: #0f172a;
    color: white;
    padding: 2rem;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-photo {
    width: 8rem;
    height: 8rem;
    background: #475569;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.header-info {
    flex: 1;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.header h2 {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-item .icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

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

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: bold;
    color: #0f172a;
    margin-bottom: 1.5rem;
}

.summary-text {
    color: #475569;
    line-height: 1.7;
}

/* Cards */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    background: white;
}

.card-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-content {
    padding: 1.5rem;
}

.job-info {
    flex: 1;
}

.job-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.company {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.company .icon {
    width: 1rem;
    height: 1rem;
}

.date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    white-space: nowrap;
}

.date .icon {
    width: 1rem;
    height: 1rem;
}

.achievement-list {
    list-style: disc;
    padding-left: 1.25rem;
    color: #475569;
}

.achievement-list li {
    margin-bottom: 0.5rem;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.skill-category {
    margin-bottom: 1rem;
}

.skill-category:last-child {
    margin-bottom: 0;
}

.skill-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.project-description {
    color: #475569;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Certifications */
.certifications-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.certification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.certification-info {
    flex: 1;
}

.certification-name {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.certification-org {
    font-size: 0.875rem;
    color: #64748b;
}

/* Icons */
.icon {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading .icon {
    animation: spin 1s linear infinite;
}

/* Print Styles */
@media print {
    body {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .export-btn {
        display: none !important;
    }
    
    .cv-wrapper {
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    .container {
        background-color: white !important;
    }
    
    .no-break {
        page-break-inside: avoid;
    }
}

@page {
    margin: 0.5in;
    size: A4;
}

/* Responsive Design */
@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        align-items: center;
    }
    
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .certifications-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .export-btn {
        top: 1rem;
        right: 1rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date {
        align-self: flex-start;
    }
}