* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #000;
}

h2 {
    margin-bottom: 15px;
    color: #000;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.form-section {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

.buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.download-btn, .add-btn {
    background-color: #000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.download-btn:hover, .add-btn:hover {
    background-color: #333;
}

.clear-btn {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.clear-btn:hover {
    background-color: #e0e0e0;
}

.remove-btn {
    background-color: #ff3333;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.remove-btn:hover {
    background-color: #e60000;
}

.enhance-btn {
    background-color: #4d4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    transition: background-color 0.3s;
}

.enhance-btn:hover {
    background-color: #666;
}

.date-range {
    display: flex;
    gap: 15px;
}

.date-range .input-group {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.checkbox-group input {
    width: auto;
    margin-right: 5px;
}

.experience-item, .education-item, .project-item {
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #fafafa;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.skill-tag {
    background-color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.skill-tag span {
    margin-right: 5px;
}

.skill-tag button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
}

.resume-preview {
    margin-top: 30px;
}

.preview-container {
    background: white;
    padding: 30px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

.social-links {
    margin-bottom: 20px;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.prefix {
    background-color: #f0f0f0;
    padding: 10px;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.input-with-prefix input {
    border: none;
    border-radius: 0;
    flex: 1;
}

/* Preview Templates */
.classic-template {
    font-family: 'Times New Roman', Times, serif;
}

.modern-template {
    font-family: 'Arial', sans-serif;
}

.simple-template {
    font-family: 'Courier New', Courier, monospace;
}

/* Template Selector */
.template-selector {
    margin-bottom: 20px;
}

.templates {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.template {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.template:hover {
    background-color: #f0f0f0;
}

.template.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

/* Resume Preview Styles */
.preview-header {
    text-align: center;
    margin-bottom: 20px;
}

.preview-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.preview-header p {
    font-size: 16px;
    color: #666;
}

.preview-section {
    margin-bottom: 20px;
}

.preview-section h2 {
    font-size: 18px;
    border-bottom: 1px solid #000;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.contact-item i {
    margin-right: 5px;
}

.social-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.social-item i {
    width: 20px;
    margin-right: 5px;
}

.experience-entry, .education-entry, .project-entry {
    margin-bottom: 15px;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.entry-title {
    font-weight: bold;
}

.entry-date {
    font-style: italic;
    color: #666;
}

.entry-subtitle {
    margin-bottom: 5px;
}

.entry-description {
    font-size: 14px;
    white-space: pre-line;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-skill {
    background-color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
}

/* Modern Template Specific */
.modern-template .preview-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modern-template .preview-section h2 {
    background-color: #f0f0f0;
    padding: 5px 10px;
    border: none;
}

/* Simple Template Specific */
.simple-template .preview-header h1 {
    text-transform: uppercase;
    letter-spacing: 2px;
}

.simple-template .preview-section h2 {
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* For PDF generation - avoid page breaks inside elements */
@media print {
    .experience-entry, .education-entry, .project-entry {
        page-break-inside: avoid;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .date-range {
        flex-direction: column;
        gap: 5px;
    }
    
    .buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .download-btn, .clear-btn {
        width: 100%;
    }
    
    .preview-container {
        padding: 15px;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .input-with-prefix {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .prefix {
        width: 100%;
        border-bottom: 1px solid #ddd;
    }
    
    .templates {
        flex-direction: column;
    }
    
    .template {
        width: 100%;
        text-align: center;
    }
    
    .preview-header h1 {
        font-size: 22px;
    }
    
    .preview-header p {
        font-size: 14px;
    }
    
    .social-links-preview {
        font-size: 12px;
    }
    
    .entry-header {
        flex-direction: column;
    }
    
    .entry-date {
        margin-top: 3px;
    }
}

/* Print styles for PDF generation */
@media print {
    body {
        background-color: white;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    .form-container, .buttons, .template-selector {
        display: none;
    }
    
    .resume-preview {
        margin: 0;
    }
    
    .preview-container {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .preview-section {
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
}

/* Better responsive sizing for form elements */
@media (max-width: 992px) {
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS devices */
    }
    
    .experience-item, .education-item, .project-item {
        padding: 10px;
    }
    
    .enhance-btn, .remove-btn, .add-btn {
        width: 100%;
        margin-top: 8px;
    }
    
    .skills-list {
        gap: 8px;
    }
    
    .skill-tag {
        font-size: 12px;
    }
}

/* Fix for mobile overflow issues */
.input-group, .date-range {
    max-width: 100%;
    overflow-x: hidden;
}

textarea {
    max-width: 100%;
}

/* Better touch targets for mobile */
@media (max-width: 576px) {
    .remove-btn, .enhance-btn, .add-btn {
        padding: 10px;
        margin-top: 10px;
    }
    
    .checkbox-group label {
        padding: 8px 0;
    }
    
    .checkbox-group input {
        width: 20px;
        height: 20px;
    }
    
    /* Fix for the social media prefix inputs */
    .input-with-prefix input {
        padding: 12px;
    }
}