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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 50px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.25);
}

header {
    text-align: center;
    margin-bottom: 45px;
    padding-bottom: 25px;
    border-bottom: 4px solid #667eea;
}

header h1 {
    color: #2c3e50;
    font-size: 2.8em;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    color: #7f8c8d;
    font-size: 1.15em;
    font-weight: 400;
}

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    margin-top: 10px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.main-content {
    text-align: center;
}

.intro-section h2 {
    color: #333;
    margin-bottom: 30px;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.btn {
    display: inline-block;
    padding: 16px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #653a8a 0%, #5568d3 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9em;
}

.features {
    text-align: left;
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.features h3 {
    color: #333;
    margin-bottom: 15px;
}

.features ul {
    list-style: none;
}

.features li {
    padding: 10px 0;
    color: #555;
    position: relative;
    padding-left: 25px;
}

.features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Form Styles */
.resume-form {
    text-align: left;
}

.form-section {
    margin-bottom: 45px;
    padding: 35px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.6em;
    font-weight: 700;
    border-bottom: 3px solid #667eea;
    padding-bottom: 12px;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #667eea;
    background: #f8f9ff;
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: #7f8c8d;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.experience-item,
.education-item {
    padding: 25px;
    background: white;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.template-option {
    padding: 18px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
}

.template-option:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.template-option input[type="radio"] {
    display: none;
}

.template-option input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 700;
}

.template-option input[type="radio"]:checked ~ * {
    border-color: #667eea;
}

.template-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    transform: translateY(-3px);
}

@media (max-width: 1024px) {
    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* Preview Styles */
.preview-container {
    max-width: 1000px;
    margin: 0 auto;
}

.preview-actions {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.template-name-display {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf4 100%);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
    border: 2px solid #667eea;
}

.resume-preview {
    background: white;
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    min-height: 800px;
    overflow: hidden;
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    @page {
        margin: 0 !important;
        padding: 0 !important;
        size: A4 portrait;
    }
    
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        background: white !important;
    }
    
    .template-name-display,
    .template-switcher,
    button,
    .btn {
        display: none !important;
    }
    
    .preview-container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        background: white !important;
    }
    
    .preview-actions {
        display: none !important;
    }
    
    .resume-preview {
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: white !important;
    }
    
    .resume-template {
        margin: 0 !important;
        width: 100% !important;
        background: white !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .template-selection {
        flex-direction: column;
    }
}
