:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --radius: 12px;
}

[data-theme="dark"] {
    --primary-color: #4cc9f0;
    --secondary-color: #4361ee;
    --accent-color: #3a0ca3;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --border-color: #343a40;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: var(--transition);
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.theme-toggle button {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
    padding: 12px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 1rem;
}

.theme-toggle button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    align-items: start;
}

/* Sidebar Styles */
.sidebar {
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    font-size: 1.3rem;
}

.template-options {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.template {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.template:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.template.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.template-preview {
    width: 24px;
    height: 24px;
    border: 2px solid currentColor;
    border-radius: 4px;
}

.template[data-template="professional"] .template-preview {
    background: linear-gradient(45deg, #4361ee 50%, #3a0ca3 50%);
}

.template[data-template="modern"] .template-preview {
    background: linear-gradient(45deg, #4cc9f0 50%, #4361ee 50%);
}

.template[data-template="creative"] .template-preview {
    background: linear-gradient(45deg, #f72585 50%, #7209b7 50%);
}

.template[data-template="executive"] .template-preview {
    background: linear-gradient(45deg, #2a9d8f 50%, #264653 50%);
}

/* Export Options */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.export-btn {
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.export-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tips-section ul {
    padding-left: 20px;
}

.tips-section li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Form Section */
.form-section {
    background: var(--surface-color);
    padding: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.section-toggle:hover {
    color: var(--primary-color);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input, textarea, select {
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--background-color);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
    font-size: 1rem;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* Image Upload */
.image-upload {
    margin-top: 10px;
}

.image-upload label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.image-preview {
    margin-top: 15px;
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--background-color);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview span {
    color: var(--text-secondary);
    text-align: center;
    padding: 10px;
}

/* Item Styles */
.experience-item, .education-item, .skill-item {
    background: var(--background-color);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    position: relative;
}

.experience-item:hover, .education-item:hover, .skill-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.remove-btn {
    background: #e63946;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
    width: 100%;
}

.remove-btn:hover {
    background: #d00000;
    transform: translateY(-1px);
}

.add-btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.add-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Preview Section */
.preview-section {
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 0 25px;
    margin-bottom: 20px;
}

.preview-header h2 {
    color: var(--primary-color);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-btn {
    background: var(--background-color);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.preview-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

#zoomLevel {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

.resume-preview {
    background: white;
    min-height: 800px;
    padding: 40px;
    border: 1px solid var(--border-color);
    margin: 0 25px 25px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.preview-placeholder {
    text-align: center;
    color: #6c757d;
    padding: 100px 20px;
}

.preview-placeholder h3 {
    margin-bottom: 15px;
    color: #495057;
}

/* Resume Template Styles */
.resume-template {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.4;
    color: #333;
    max-width: 100%;
}

.resume-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

.resume-header h2 {
    font-size: 28px;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.resume-header .job-title {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 600;
}

.resume-header .contact-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #555;
}

.resume-section {
    margin-bottom: 25px;
}

.resume-section h3 {
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-weight: bold;
}

.experience-item-preview, .education-item-preview {
    margin-bottom: 20px;
}

.experience-item-preview h4, .education-item-preview h4 {
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.experience-item-preview .company, .education-item-preview .institution {
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

.experience-item-preview .duration, .education-item-preview .duration {
    font-style: italic;
    color: #888;
    margin-bottom: 8px;
    font-size: 13px;
}

.experience-item-preview p, .education-item-preview p {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid #ddd;
}

/* Template Variations */
.resume-template.modern {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.resume-template.modern .resume-header {
    border-bottom: 3px solid var(--primary-color);
}

.resume-template.modern .resume-section h3 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}

.resume-template.creative {
    font-family: 'Georgia', serif;
    background: #f9f7f7;
    padding: 30px;
}

.resume-template.creative .resume-header {
    border-bottom: 2px dashed #333;
}

.resume-template.creative .resume-section h3 {
    color: #d63384;
    border-bottom: 1px dashed #d63384;
}

.resume-template.executive {
    font-family: 'Arial', sans-serif;
}

.resume-template.executive .resume-header {
    background: #2a9d8f;
    color: white;
    padding: 25px;
    margin: -40px -40px 30px -40px;
    border-bottom: none;
}

.resume-template.executive .resume-header h2,
.resume-template.executive .resume-header .job-title,
.resume-template.executive .resume-header .contact-info {
    color: white;
}

.resume-template.executive .resume-section h3 {
    color: #2a9d8f;
    border-bottom: 2px solid #2a9d8f;
}

/* Success Messages */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    z-index: 1000;
    font-weight: 600;
}

.error-message {
    background: #e63946;
}

.info-message {
    background: var(--primary-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .preview-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .resume-header .contact-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Print Styles */
@media print {
    .sidebar, .form-section, header, .preview-header {
        display: none;
    }
    
    .dashboard, .main-content {
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .preview-section {
        width: 100%;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    
    .resume-preview {
        box-shadow: none;
        border: none;
        min-height: auto;
        padding: 20px;
        margin: 0;
    }
    
    .resume-template.executive .resume-header {
        margin: 0;
    }
}