/* ===== VARIABLES ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --accent: #06b6d4;
    --dark: #1e293b;
    --darker: #0f172a;
    --light: #f8fafc;
    --light-gray: #f1f5f9;
    --gray: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --font-main: 'Inter', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition: all 0.3s ease;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--dark);
    background-color: #f8fafc;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    border: 1px solid transparent;
}

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

.btn.primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

.btn.icon {
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.btn.small {
    padding: 8px 14px;
    font-size: 14px;
}

.btn.large {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

/* ===== LANDING PAGE STYLES ===== */
.navbar {
    background-color: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--darker);
}

.logo i {
    color: var(--primary);
    font-size: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: var(--gray);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.mobile-menu {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.hero {
    padding: 100px 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--darker);
    max-width: 600px;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 30px;
    max-width: 550px;
}

.cta-container {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-item p {
    color: var(--gray);
    font-size: 0.95rem;
}

.hero-image {
    flex: 1;
    position: relative;
}

.resume-mockup {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 30px;
    width: 100%;
    max-width: 500px;
    transform: rotate(3deg);
    border: 1px solid var(--border);
    position: relative;
    z-index: 2;
}

.resume-header {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.resume-header h2 {
    font-size: 28px;
    color: var(--darker);
}

.resume-header p {
    color: var(--primary);
    font-weight: 500;
    font-size: 18px;
}

.resume-section {
    margin-bottom: 25px;
}

.resume-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--darker);
}

.resume-section h3 i {
    color: var(--primary);
    font-size: 16px;
}

.resume-item {
    margin-bottom: 20px;
}

.resume-item h4 {
    font-size: 18px;
    margin-bottom: 5px;
}

.resume-item p {
    color: var(--gray);
    font-size: 15px;
    margin-bottom: 10px;
}

.resume-item ul {
    padding-left: 20px;
    margin-top: 10px;
}

.resume-item li {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--dark);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--darker);
}

.section-header p {
    color: var(--gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.features {
    padding: 100px 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-card .icon {
    width: 70px;
    height: 70px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.feature-card .icon i {
    font-size: 28px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--darker);
}

.feature-card p {
    color: var(--gray);
}

.templates {
    padding: 100px 0;
    background: var(--light);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.template-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.template-preview {
    height: 350px;
    background-size: cover;
    background-position: top;
}

.template-modern {
    background-color: #dbeafe;
    background-image: linear-gradient(to bottom, #dbeafe, #eff6ff);
}

.template-executive {
    background-color: #ede9fe;
    background-image: linear-gradient(to bottom, #ede9fe, #f5f3ff);
}

.template-creative {
    background-color: #f0fdfa;
    background-image: linear-gradient(to bottom, #f0fdfa, #ecfeff);
}

.template-minimal {
    background-color: #fffbeb;
    background-image: linear-gradient(to bottom, #fffbeb, #fef9c3);
}

.template-card h3 {
    padding: 20px 20px 10px;
    color: var(--darker);
}

.template-card p {
    padding: 0 20px 20px;
    color: var(--gray);
}

.testimonials {
    padding: 100px 0;
    background: white;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.quote {
    margin-bottom: 25px;
    position: relative;
    padding-left: 30px;
}

.quote i {
    position: absolute;
    left: 0;
    top: 0;
    color: rgba(37, 99, 235, 0.1);
    font-size: 50px;
}

.quote p {
    color: var(--dark);
    font-size: 16px;
    line-height: 1.7;
}

.user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--light-gray);
}

.user h4 {
    font-size: 18px;
    margin-bottom: 5px;
}

.user p {
    color: var(--gray);
    font-size: 14px;
}

.cta {
    padding: 100px 0;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    text-align: center;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0.9;
}

footer {
    background: var(--darker);
    color: white;
    padding: 70px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 60px;
}

.footer-brand .logo {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: white;
}

.footer-brand p {
    color: var(--light-gray);
    max-width: 300px;
    margin-bottom: 20px;
}

.social {
    display: flex;
    gap: 15px;
}

.social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-links h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: white;
}

.footer-links a {
    display: block;
    color: var(--light-gray);
    margin-bottom: 12px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* ===== BUILDER PAGE STYLES ===== */
.builder-container {
    display: flex;
    min-height: calc(100vh - 70px);
    gap: 40px;
    padding: 30px;
    max-width: 1600px;
    margin: 0 auto;
    flex-wrap: wrap; /* Allow columns to wrap on small screens */
}

.form-column {
    flex: 1;
    min-width: 300px; /* Prevent too narrow columns */
    max-width: 700px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    height: fit-content;
    position: sticky;
    top: 30px;
    align-self: flex-start;
    max-height: 90vh;
    overflow-y: auto;
}

.form-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.form-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--darker);
}

.form-header h2 i {
    color: var(--primary);
}

.form-header p {
    color: var(--gray);
}

.form-section {
    margin-bottom: 35px;
    display: none;
}

.form-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    color: var(--darker);
}

.section-header h3 i {
    color: var(--primary);
    font-size: 1.1rem;
}

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

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--darker);
}

input, textarea, select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font-main);
    transition: var(--transition);
    background: white;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.hint {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 5px;
}

.entry {
    background: var(--light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    display: none;
}

.entry.active {
    display: block;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.entry-header h4 {
    color: var(--gray);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.preview-column {
    flex: 1;
    min-width: 300px; /* Prevent too narrow columns */
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
}

.preview-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.preview-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--darker);
}

.preview-header h2 i {
    color: var(--primary);
}

.preview-header p {
    color: var(--gray);
}

#cv-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* Tab Styles */
.experience-tabs, .education-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto; /* Enable horizontal scrolling for tabs */
    padding-bottom: 10px;
}

.tab {
    padding: 8px 16px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    flex-shrink: 0; /* Prevent tabs from shrinking */
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab:hover {
    background: var(--light-gray);
}

.add-button-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* ===== CV TEMPLATE STYLES ===== */
.cv-page {
    background: white;
    width: 210mm;
    min-height: 297mm;
    padding: 25mm;
    box-sizing: border-box;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    color: #334155;
    position: relative;
}

.cv-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 3px solid var(--primary);
}

.cv-header h1 {
    font-size: 36px;
    color: #1e293b;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.cv-header h2 {
    font-size: 20px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 20px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
    font-size: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
}

.contact-item i {
    color: var(--primary);
    width: 16px;
}

.summary-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.section-title i {
    font-size: 16px;
    color: var(--primary);
}

.section-content {
    font-size: 14px;
    line-height: 1.7;
    color: #475569;
}

.job-entry, .education-entry, .project-entry, .certification-entry {
    margin-bottom: 22px;
}

.entry-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.entry-name {
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
}

.entry-date {
    color: #64748b;
    font-size: 14px;
}

.entry-subtitle {
    font-style: italic;
    color: #64748b;
    margin-bottom: 8px;
    font-size: 14px;
}

.entry-description {
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.6;
    color: #475569;
}

.skills-container {
    display: flex;
    gap: 30px;
}

.skill-column {
    flex: 1;
}

.skill-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.skill-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.skill-list li:before {
    content: "•";
    color: var(--primary);
    font-size: 20px;
    line-height: 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1400px) {
    .builder-container {
        gap: 30px;
    }
}

@media (max-width: 1200px) {
    .form-column, .preview-column {
        min-width: 100%; /* Full width on medium screens */
    }
    
    .form-column {
        position: relative;
        top: 0;
        max-height: none;
    }
}

@media (max-width: 1100px) {
    .builder-container {
        flex-direction: column;
    }
    
    .form-column {
        max-width: 100%;
    }
    
    .preview-column {
        width: 100%;
    }
    
    .cv-page {
        width: 100% !important; /* Ensure CV preview fits */
        min-height: auto;
    }
}

@media (max-width: 900px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        margin-bottom: 50px;
    }
    
    .cta-container {
        justify-content: center;
    }
    
    .stats {
        justify-content: center;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .experience-tabs, .education-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .tab {
        max-width: 180px;
    }
    
    .form-column, .preview-column {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .form-header h2 {
        font-size: 1.6rem;
    }
    
    .preview-header h2 {
        font-size: 1.6rem;
    }
    
    .section-header h3 {
        font-size: 1.2rem;
    }
    
    .tab {
        max-width: 160px;
    }
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .cta-container {
        flex-direction: column;
    }
    
    .features-grid, .templates-grid, .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .tab {
        max-width: 150px;
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .form-column, .preview-column {
        padding: 20px;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .preview-header h2 {
        font-size: 1.5rem;
    }
    
    input, textarea {
        padding: 12px 14px;
    }
    
    .skills-container {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .builder-container {
        padding: 15px;
    }
    
    .form-column, .preview-column {
        padding: 15px;
    }
    
    .tab {
        max-width: 130px;
        font-size: 12px;
    }
    
    .section-header h3 {
        font-size: 1.1rem;
    }
    
    .form-navigation .btn {
        padding: 8px 14px;
        font-size: 14px;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .feature-card {
        padding: 20px;
    }
}

    .entry-description {
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word; /* Break long words */
}