:root {
    --primary-color: #FF5B04;
    --primary-hover: #d94a00;
    --primary-rgb: 255, 91, 4;
    --secondary-color: #16232A;
    --accent-color: #025E66;
    --accent-rgb: 2, 94, 102;
    --bg-color: #E4EEF0;
    --surface-color: #f8fbfb;
    --text-main: #16232A;
    --text-muted: #5B6C73;
    --border-color: #C8D6DA;
    --success-color: #025E66;
    --warning-color: #FF9A3D;
    --danger-color: #C94B2B;
    --chat-bg: #DCE7E9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Base Components & Utilities */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f1f5f9;
}

.btn-icon {
    padding: 6px;
    background: transparent;
    color: var(--primary-color);
    border-radius: 4px;
}

.btn-icon:hover {
    background: rgba(var(--primary-rgb), 0.12);
}

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

.default-hidden {
    display: flex !important;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    min-height: 60px;
    flex-shrink: 0;
    z-index: 100;
}

.navbar h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary-color);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Main App Container */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.dashboard-pane {
    flex: 2;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    /* Softer gray */
    padding-bottom: 40px;
    overflow-y: auto;
    position: relative;
    box-shadow: inset 1px 0 10px rgba(0, 0, 0, 0.02);
}

.tabs {
    display: flex;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab-btn {
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    padding: 24px;
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Chat Pane (Right) */
.chat-pane {
    flex: 1;
    min-width: 350px;
    max-width: 450px;
    background-color: var(--surface-color);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    color: var(--secondary-color);
}

.chat-history {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--chat-bg);
}

.message {
    display: flex;
    gap: 0;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message .avatar {
    width: 28px;
    height: 28px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.message.user .avatar {
    background-color: var(--secondary-color);
}

.message .bubble {
    background-color: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.user .bubble {
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    border-top-right-radius: 2px;
}

.chat-input-area {
padding: 16px;
display: flex;
gap: 10px;

}

#chatInput {
    flex: 1;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

#chatInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
}

/* Resume Document Styles (The Previews) */
.resume-wrapper {
    background: white;
    width: 100%;
    max-width: 800px;
    min-height: 1056px;
    /* A4 Ratio */
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    /* Slight rounding for softness */
    padding: 48px;
    position: relative;
    margin-top: 16px;
}

.editable-content {
    outline: none;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
}

.editable-content:hover,
.editable-content:focus {
    background: rgba(var(--accent-rgb), 0.08);
    border-color: rgba(var(--accent-rgb), 0.22);
}

.resume-section {
    position: relative;
    margin-bottom: 24px;
}

.resume-section .enhance-btn {
    position: absolute;
    right: -30px;
    top: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.resume-section:hover .enhance-btn {
    opacity: 1;
}

/* Template: Modern Professional */
.resume-wrapper.modern .resume-header {
    text-align: left;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.resume-wrapper.modern h1 {
    font-size: 32px;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.resume-wrapper.modern h2 {
    font-size: 18px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.resume-wrapper.modern .contact-info {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.resume-wrapper.modern .item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

/* Template: ATS Classic */
.resume-wrapper.classic {
    font-family: 'Times New Roman', Times, serif;
}

.resume-wrapper.classic h1 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 8px;
}

.resume-wrapper.classic .contact-info {
    justify-content: center;
    border-bottom: 1px solid #000;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.resume-wrapper.classic h2 {
    border-bottom: 1px solid #000;
    margin-bottom: 12px;
    padding-bottom: 4px;
}

/* Skills Tags */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: rgba(var(--accent-rgb), 0.12);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-main);
}

.missing-skills .skill-tag {
    background: #fef2f2;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Project Links */
.project-links {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.proj-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.proj-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Analysis Dashboard */
.analysis-dashboard,
.personalize-tool {
    width: 100%;
    max-width: 800px;
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.score-card {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 8px solid var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--success-color);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.metric-box {
    background: var(--bg-color);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.metric-box h4 {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-box .m-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    margin-top: 8px;
}

.feedback-list {
    list-style: none;
}

.feedback-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.feedback-list li.warning {
    background: rgba(var(--primary-rgb), 0.1);
    color: #a94208;
}

.feedback-list li.suggestion {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent-color);
}

.run-analysis-btn {
    width: 100%;
    justify-content: center;
    margin-top: 24px;
    padding: 12px;
    font-size: 16px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 16px 0;
    font-family: inherit;
}

.suggestion-card {
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.old-text {
    color: var(--text-muted);
    text-decoration: line-through;
}

.new-text {
    color: var(--success-color);
    font-weight: 500;
}

/* Authentication Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
}

.w-100 {
    width: 100%;
    justify-content: center;
    padding: 10px;
}

.mt-3 {
    margin-top: 16px;
}

.auth-switch {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider::before {
    margin-right: 10px;
}

.auth-divider::after {
    margin-left: 10px;
}

.btn-google {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: white;
    font-weight: 500;
    padding: 10px;
    border: 1px solid var(--border-color);
}

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

.auth-error {
    color: var(--danger-color);
    background: #fef2f2;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

.auth-debug {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Landing Page Styles */
.landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    background: linear-gradient(135deg, #16232A 0%, #025E66 42%, #E4EEF0 100%);
    padding: 60px 24px 60px 24px;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.6;
    animation: floating 10s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(var(--primary-rgb), 0.22);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: rgba(var(--accent-rgb), 0.24);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes floating {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(30px) scale(1.1);
    }
}

.landing-hero-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    z-index: 1;
    gap: 40px;
}

.hero-content {
    flex: 1;
    min-width: 320px;
    max-width: 650px;
    padding-top: 20px;
}

.hero-content .badge {
    display: inline-block;
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(var(--accent-rgb), 0.22);
}

.hero-content h1 {
    font-size: 56px;
    font-weight: 800;
    color: #f8fbfb;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.hero-content .highlight {
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #ff9a3d);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 20px;
    color: rgba(248, 251, 251, 0.78);
    margin-bottom: 40px;
    line-height: 1.6;
}

.landing-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
}

.cta-subtext {
    font-size: 14px;
    color: rgba(248, 251, 251, 0.72);
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
    border-radius: 12px;
    box-shadow: 0 12px 24px -6px rgba(var(--primary-rgb), 0.45);
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px -8px rgba(var(--primary-rgb), 0.55);
}

.landing-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.feature-icon {
    font-size: 24px;
    color: var(--primary-color);
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.feature-card h3 {
    font-size: 18px;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Floating UI Mockup */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 320px;
}

.floating-mockup {
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1), 0 0 0 10px rgba(255, 255, 255, 0.3);
    overflow: hidden;
    animation: mockupFloat 6s ease-in-out infinite alternate;
}

@keyframes mockupFloat {
    0% {
        transform: translateY(0) rotateX(2deg) rotateY(-2deg);
    }

    100% {
        transform: translateY(-15px) rotateX(-2deg) rotateY(2deg);
    }
}

.mockup-header {
    background: #edf3f4;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.mockup-header .dots {
    display: flex;
    gap: 6px;
}

.mockup-header .dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #b9c8ce;
}

.mockup-header .dots span:nth-child(1) {
    background: #ff5f56;
}

.mockup-header .dots span:nth-child(2) {
    background: #ffbd2e;
}

.mockup-header .dots span:nth-child(3) {
    background: #27c93f;
}

.mockup-header .title {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 48px;
    /* Offset the dots */
}

.mockup-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mock-chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    max-width: 85%;
    line-height: 1.5;
}

.mock-chat-bubble.ai {
    background: #f1f5f9;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.mock-chat-bubble.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.mock-chat-bubble.generating {
    color: var(--primary-color);
    font-style: italic;
    font-weight: 500;
}

.mock-resume-preview {
    margin-top: 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

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

.m-line.w-long {
    width: 60%;
    height: 12px;
    background: var(--secondary-color);
    margin-bottom: 16px;
}

.m-line.w-full {
    width: 100%;
}

.m-line.w-med {
    width: 40%;
    background: var(--primary-color);
}

.m-line.pt {
    margin-top: 12px;
}

.m-line.pt2 {
    margin-top: 8px;
}

/* About Section */
.landing-about {
    width: 100%;
    max-width: 1200px;
    margin-top: 80px;
    padding: 60px 40px;
    background: rgba(248, 251, 251, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    z-index: 1;
}

.about-header {
    text-align: center;
    margin-bottom: 40px;
}

.about-header h2 {
    font-size: 36px;
    color: var(--secondary-color);
    font-weight: 700;
}

.about-header .highlight {
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #ff9a3d);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-line {
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    margin: 16px auto 0;
}

.about-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.about-text {
    flex: 1;
    min-width: 320px;
}

.about-text p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-stats {
    flex: 1;
    min-width: 320px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.stat-box {
    background: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-box p {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

@media print {
    body.export-pdf-mode {
        background: #ffffff;
        height: auto;
        overflow: visible;
    }

    body.export-pdf-mode .navbar,
    body.export-pdf-mode .chat-pane,
    body.export-pdf-mode .tabs,
    body.export-pdf-mode .landing-page,
    body.export-pdf-mode #tab-analysis,
    body.export-pdf-mode #tab-personalize {
        display: none !important;
    }

    body.export-pdf-mode #mainAppContainer,
    body.export-pdf-mode .dashboard-pane,
    body.export-pdf-mode #tab-preview,
    body.export-pdf-mode .tab-content {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    body.export-pdf-mode #resumeDocument {
        margin: 0 auto !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 210mm !important;
        min-height: auto !important;
    }
}