/* Resume Formatter - Modern CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --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;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Upload Section */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--white);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--gray-50);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    background-opacity: 0.05;
    transform: scale(1.02);
}

.upload-content i {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.upload-content h3 {
    font-size: 1.5rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.browse-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.upload-info {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* File Preview */
.file-preview {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.file-info i {
    font-size: 2rem;
    color: var(--primary-color);
}

.file-details h4 {
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.file-details p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.remove-file {
    background: var(--danger-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.text-preview {
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}

.text-preview h5 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.text-preview p {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

/* Template Section */
.templates-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.template-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.template-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.template-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    background-opacity: 0.05;
}

.template-card h4 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.template-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.template-card .check-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--primary-color);
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card.selected .check-icon {
    opacity: 1;
}

/* Job Optimization Section */
.job-optimization-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
}

.job-optimization-section h4 {
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.job-description-help {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.job-description-container {
    margin-bottom: 1rem;
}

.job-description-input {
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 400px;
        transform: translateY(0);
    }
}

.job-description-label {
    display: block;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.job-description-input textarea {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--gray-50);
}

.job-description-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--white);
}

.job-description-input textarea::placeholder {
    color: var(--gray-400);
    line-height: 1.6;
}

.character-count {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.character-count.warning {
    color: var(--warning-color);
}

.character-count.error {
    color: var(--danger-color);
}

/* Options */
.options {
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Processing Section */
.processing-content {
    text-align: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-md);
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-content h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

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

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-md);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Download Section */
.download-content {
    text-align: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-md);
}

.success-icon {
    margin-bottom: 2rem;
}

.success-icon i {
    font-size: 4rem;
    color: var(--secondary-color);
}

.download-content h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

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

.download-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.download-btn, .start-over-btn, .retry-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    min-width: 120px;
    justify-content: center;
}

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

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

.start-over-btn, .retry-btn {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.start-over-btn:hover, .retry-btn:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Error Section */
.error-content {
    text-align: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-md);
}

.error-icon {
    margin-bottom: 2rem;
}

.error-icon i {
    font-size: 4rem;
    color: var(--danger-color);
}

.error-content h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

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

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--gray-200);
}

.footer p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-dark);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--gray-600);
}

.modal h2 {
    color: var(--gray-700);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.info-steps {
    display: grid;
    gap: 1.5rem;
}

.info-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.info-step i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.info-step h4 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-step p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.privacy-info ul {
    list-style: none;
    padding-left: 0;
}

.privacy-info li {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.privacy-info li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-content h3 {
        font-size: 1.25rem;
    }
    
    .download-actions, .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .download-btn, .start-over-btn, .retry-btn {
        min-width: 200px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    .step-indicator {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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