:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #059669;
    --error-color: #dc2626;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --background: #f9fafb;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --border-radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.generator-form {
    background: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group .error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--card-background);
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group.half {
    flex: 1;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    display: inline-block;
    background-color: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: var(--background);
}

.cv-format-help {
    margin-top: 2rem;
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cv-format-help h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.cv-format-help summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
}

.cv-format-help pre {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 0.85rem;
}

.cv-format-help code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Result page styles */
.result-success,
.result-error {
    background: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.error-icon {
    width: 60px;
    height: 60px;
    background: var(--error-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.result-success h2 {
    color: var(--success-color);
    margin-bottom: 1.5rem;
}

.result-error h2 {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.result-details {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    text-align: left;
}

.result-details p {
    margin: 0.5rem 0;
}

.download-section {
    margin-top: 2rem;
}

.download-section h3 {
    margin-bottom: 1rem;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-download:hover {
    background-color: var(--primary-hover);
}

.btn-download .icon {
    font-size: 1.25rem;
}

.download-note {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.error-message {
    background: #fef2f2;
    color: var(--error-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.error-suggestions {
    text-align: left;
    background: var(--background);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.error-suggestions h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.error-suggestions ul {
    margin-left: 1.5rem;
}

.error-suggestions li {
    margin: 0.5rem 0;
}

.actions {
    margin-top: 2rem;
    text-align: center;
}

.auth-info {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--background);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.guest-info {
    display: flex;
    gap: 0.5rem;
}

.btn-login, .btn-register {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-login {
    background-color: var(--primary-color);
    color: white;
}

.btn-login:hover {
    background-color: var(--primary-hover);
}

.btn-register {
    background-color: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-register:hover {
    background-color: var(--background);
}

.btn-logout {
    background-color: var(--error-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
    margin-left: 0.5rem;
}

.btn-logout:hover {
    background-color: #b91c1c;
}

.btn-profile {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-profile:hover {
    background-color: var(--primary-hover);
}

footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .generator-form {
        padding: 1rem;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .btn-download {
        width: 100%;
        justify-content: center;
    }
}

/* Loading Animation Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-content {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.loading-content h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.encouraging-message {
    color: #1f2937; /* Use direct color instead of variable for reliability */
    font-size: 1.1rem;
    margin-top: 1rem;
    min-height: 24px;
    transition: opacity 0.3s ease;
    font-weight: 500;
    padding: 0.5rem;
    background-color: rgba(37, 99, 235, 0.05); /* Light blue background for visibility */
    border-radius: 4px;
    border: 1px solid rgba(37, 99, 235, 0.2); /* Light border for debugging */
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-container {
    width: 100%;
    background-color: #f3f4f6;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    height: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
    display: none; /* Hide by default */
}

.progress-text {
    margin-top: 1rem;
    color: var(--text-secondary);
    display: none; /* Hide by default */
}

.progress-text {
    margin-top: 1rem;
    color: var(--text-secondary);
}

#progress-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

#step-text {
    font-size: 1rem;
    margin-bottom: 1rem;
    min-height: 24px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}
