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

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #f6ad55;
    --danger: #f56565;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    transform: translateY(-1px);
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.dropzone-icon {
    margin-bottom: 1rem;
}

.dropzone h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.dropzone p {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.file-types {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem !important;
}

.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: var(--gray-400);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-300);
}

.divider span {
    padding: 0 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.text-input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.text-input-section textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.text-input-section textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Loading Section */
.loading-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.loading-card {
    background: white;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
}

.spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.loading-card p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gray-500);
}

.step.active .step-icon {
    background: var(--primary);
    color: white;
}

.step span {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    margin-bottom: 1.5rem;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
}

.visual-resume {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.resume-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.resume-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--gray-800);
}

.card-title svg {
    color: var(--primary);
}

/* Resume Header */
.resume-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.header-info h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.header-info h2 {
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.separator {
    opacity: 0.5;
}

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

.social-link {
    color: white;
    opacity: 0.9;
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.social-link:hover {
    opacity: 1;
}

.confidence-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.confidence-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
}

.percent {
    font-size: 1rem;
    opacity: 0.9;
}

.confidence-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Summary Card */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Skills */
#skills-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-category {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skill-category-title {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 1rem;
}

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

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

.skill-tag.technical {
    background: #dbeafe;
    color: #1e40af;
}

.skill-tag.soft {
    background: #fce7f3;
    color: #be185d;
}

.skill-tag.certification {
    background: #d1fae5;
    color: #065f46;
}

/* Experience */
.experience-item {
    border-left: 3px solid var(--primary);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.experience-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--primary);
}

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

.experience-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.experience-company {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.experience-duration {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.duration-badge {
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}

.experience-list {
    list-style: none;
    margin-top: 1rem;
}

.experience-list li {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.experience-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Education */
.education-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.education-icon {
    font-size: 2rem;
}

.education-content {
    flex: 1;
}

.education-degree {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.education-institution {
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.education-year {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Analysis */
.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quality-badge {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.quality-badge.excellent {
    background: #d1fae5;
    color: #065f46;
}

.quality-badge.good {
    background: #dbeafe;
    color: #1e40af;
}

.quality-badge.average {
    background: #fef3c7;
    color: #92400e;
}

.quality-badge.poor {
    background: #fee2e2;
    color: #991b1b;
}

.missing-info h4,
.recommendations h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.missing-info ul,
.recommendations ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.missing-info li,
.recommendations li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.missing-info li::before {
    content: '⚠️';
    position: absolute;
    left: 0;
}

.recommendations li::before {
    content: '💡';
    position: absolute;
    left: 0;
}

/* Error Section */
.error-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.error-card {
    background: white;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-card h2 {
    color: var(--danger);
    margin-bottom: 1rem;
}

.error-card p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
    }

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

    .confidence-badge {
        align-self: flex-start;
    }

    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .results-actions {
        flex-direction: column;
    }

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