:root {
    --primary-color: #3b82f6;
    --secondary-color: #1d4ed8;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    --background-color: #111827;
    --text-color: #f8fafc;
    --border-color: #334155;
    --primary-color: #3b82f6;
    --secondary-color: #1d4ed8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --heading-color: #f3f4f6;
    --subtext-color: #94a3b8;
    --input-bg: #1f2937;
    --input-border: #374151;
    --input-focus: #2563eb;
}

[data-theme="dark"] .resume {
    background-color: #1e293b;
    color: #f8fafc;
}

[data-theme="dark"] .resume-section h2 {
    color: var(--primary-color);
}

[data-theme="dark"] .skills-list li,
[data-theme="dark"] .cert-list li {
    color: #94a3b8;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: var(--background-color);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.theme-toggle:hover {
    transform: translateY(-2px);
}

[data-theme="dark"] .theme-toggle {
    background-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: #1d4ed8;
}

[data-theme="dark"] .theme-toggle:active {
    background-color: #1e40af;
}

[data-theme="light"] .theme-toggle {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

[data-theme="light"] .theme-toggle:hover {
    background-color: var(--background-color);
}

[data-theme="light"] .theme-toggle:active {
    background-color: #f1f5f9;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .resume {
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
}

[data-theme="dark"] .resume-section h2 {
    color: var(--primary-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .skills-list li,
[data-theme="dark"] .cert-list li {
    color: #94a3b8;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .resume-section p,
[data-theme="dark"] .resume-section h3 {
    color: #f1f5f9;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-container {
    background: var(--input-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.form-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -2px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--heading-color);
}

input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.2); /* Lighter border color */
    border-radius: 8px;
    box-shadow: none;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--input-bg);
    color: var(--text-color);
}

input:focus, textarea:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.4); /* Slightly darker on focus */
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Template selector styles */
.template-selector {
    background: var(--input-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.template-selector h2 {
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.template-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.template-option {
    cursor: pointer;
    padding: 1rem;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    transition: all 0.2s;
}

.template-option:hover {
    border-color: var(--input-focus);
    transform: translateY(-2px);
}

.template-option.active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.template-option span {
    color: var(--heading-color);
    display: block;
    margin-top: 0.5rem;
    text-align: center;
}

.button-group {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

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

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

.btn.secondary:hover {
    background-color: var(--background-color);
}

.preview-container {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    min-height: 600px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.preview-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -2px rgb(0 0 0 / 0.1);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.actions {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 2rem;
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: #64748b;
}

/* Template Settings Styles */
.template-settings {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.template-settings h3 {
    color: var(--heading-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.setting-group {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    transition: all 0.2s;
}

.setting-group:hover {
    border-color: var(--input-focus);
    transform: translateY(-1px);
}

.setting-group label {
    color: var(--heading-color);
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

.setting-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.2); /* Lighter border color */
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: none; /* Remove shadow */
}

.setting-group select:focus {
    border-color: rgba(0, 0, 0, 0.4); /* Slightly darker on focus */
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1); /* Optional focus effect */
}

.setting-group input[type="color"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.2); /* Lighter border color */
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: none; /* Remove shadow */
}

.setting-group input[type="color"]:focus {
    border-color: rgba(0, 0, 0, 0.4); /* Slightly darker on focus */
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1); /* Optional focus effect */
}
.color-preview {
    width: 100%;
    height: 20px;
    border-radius: 4px;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.color-preview:hover {
    transform: translateY(-1px);
}

/* Color picker styles */
.template-settings input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.template-settings input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Font size options */
.font-size-options {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.font-size-option {
    padding: 0.5rem 1rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.font-size-option:hover {
    border-color: var(--input-focus);
    background: rgba(59, 130, 246, 0.1);
}

.font-size-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Template Selector Styles */
.template-selector {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.template-selector h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.template-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.template-option {
    cursor: pointer;
    text-align: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.template-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.template-option.active {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.template-preview {
    width: 100%;
    height: 200px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    background: white;
    overflow: hidden;
    position: relative;
}

.preview-header {
    height: 40px;
    background: var(--primary-color);
    margin-bottom: 1rem;
}

.preview-header.classic {
    height: 2px;
    margin-top: 20px;
}

.preview-header.minimal {
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}

.preview-header.creative {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a78bfa 100%);
}

.preview-header.executive {
    border-bottom: 4px double var(--primary-color);
    background: none;
}

.preview-content {
    padding: 1rem;
}

.preview-line {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.preview-line.short {
    width: 60%;
}

.template-option span {
    display: block;
    font-weight: 500;
}

/* Resume Preview Styles */
.resume {
    --resume-primary: var(--primary-color);
    --resume-text: var(--text-color);
    --resume-border: var(--border-color);
    transition: all 0.3s ease;
}

/* Font size variations */
.resume[data-size="small"] {
    font-size: 12px;
}

.resume[data-size="medium"] {
    font-size: 14px;
}

.resume[data-size="large"] {
    font-size: 16px;
}

/* Spacing variations */
.resume[data-spacing="compact"] .resume-section {
    margin-bottom: 1rem;
}

.resume[data-spacing="normal"] .resume-section {
    margin-bottom: 1.5rem;
}

.resume[data-spacing="relaxed"] .resume-section {
    margin-bottom: 2rem;
}

.resume h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.resume-header {
    text-align: center;
    margin-bottom: 2rem;
}

.resume-section {
    margin-bottom: 1.5rem;
}

.resume-section ul {
    list-style-type: none;
    padding-left: 0;
}

/* Improved Form Layout */
.form-container form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    grid-column: span 2;
}

.form-group:has(input[type="text"]:not([id="fullName"]):not([id="jobTitle"])) {
    grid-column: span 1;
}

.button-group {
    grid-column: span 2;
}

/* Template Styles */
.resume[data-template="modern"] {
    --resume-primary: #2563eb;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.resume[data-template="modern"] .resume-header {
    background-color: var(--resume-primary);
    color: white;
    padding: 2rem;
    border-radius: 8px 8px 0 0;
}

.resume[data-template="modern"] .resume-section {
    padding: 0 2rem;
}

.resume[data-template="classic"] {
    --resume-primary: #1e293b;
    font-family: 'Times New Roman', serif;
    padding: 2rem;
    border: 1px solid var(--resume-border);
}

.resume[data-template="classic"] .resume-header {
    border-bottom: 2px solid var(--resume-primary);
    padding-bottom: 1rem;
}

.resume[data-template="minimal"] {
    --resume-primary: #64748b;
    font-family: 'Inter', sans-serif;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.resume[data-template="minimal"] .resume-header {
    text-align: left;
    border-left: 4px solid var(--resume-primary);
    padding-left: 1rem;
}

.resume[data-template="minimal"] .resume-section h2 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.resume[data-template="creative"] {
    --resume-primary: #8b5cf6;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f3f4f6 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 16px;
}

.resume[data-template="creative"] .resume-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    margin-bottom: 2rem;
}

.resume[data-template="creative"] .resume-section h2 {
    color: var(--resume-primary);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.resume[data-template="creative"] .resume-section h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 2rem;
    height: 2px;
    background-color: var(--resume-primary);
}

.resume[data-template="executive"] {
    --resume-primary: #334155;
    font-family: 'Georgia', serif;
    padding: 2rem;
    border: 2px solid #334155;
    position: relative;
}

.resume[data-template="executive"] .resume-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 4px double var(--resume-primary);
}

.resume[data-template="executive"] .resume-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.resume[data-template="executive"] .resume-section {
    margin-bottom: 2rem;
    padding-left: 2rem;
    border-left: 1px solid var(--resume-primary);
}

.resume[data-template="executive"] .resume-section h2 {
    font-style: italic;
    color: var(--resume-primary);
    margin-bottom: 1.5rem;
}

.resume-section li {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1rem;
    }
}
