
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #222230;
    --bg-tertiary: #252535;
    --bg-hover: #2a2a3a;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;

    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-purple-dark: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #ec4899 100%);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --danger: #dc2626;
    --danger-hover: #b91c1c;

    --border-color: rgba(255, 255, 255, 0.1);
    --accent-glow: rgba(139, 92, 246, 0.4);
    --accent-glow-strong: rgba(139, 92, 246, 0.6);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }


.popup-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.popup-content {
    background: #1a1a25;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: popupSlideIn 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

@keyframes popupSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none; border: none;
    color: #a0a0b0; font-size: 20px;
    cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.popup-close:hover { color: white; background: rgba(255,255,255,0.1); }

.popup-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.popup-icon i { font-size: 32px; color: white; }

.popup-content h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; color: white; }
.popup-content p  { color: #a0a0b0; margin-bottom: 28px; line-height: 1.6; font-size: 15px; }

.popup-buttons { display: flex; gap: 12px; justify-content: center; }
.popup-buttons a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 8px;
    font-weight: 600; font-size: 14px;
    text-decoration: none; transition: all 0.3s ease;
}
.btn-login {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white; box-shadow: 0 4px 15px rgba(139,92,246,0.4);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139,92,246,0.5); }
.btn-signup { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.2); }
.btn-signup:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }


.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    height: 80px;
    display: flex;
    align-items: center;
    transition: var(--transition-normal);
}

.nav-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left  { flex: 1; display: flex; align-items: center; margin-top: 13px; }
.nav-center { flex: 2; display: flex; justify-content: center; }
.nav-right  { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 1.5rem; }

.logo { text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-img { height: 35px; width: auto; margin-top: -28px; margin-right: -18px; display: block; }
.logo-text {
    font-size: 1.75rem; font-weight: 800;
    font-family: 'Times New Roman', Times, serif;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    letter-spacing: -0.5px;
}

.nav-links { display: flex; list-style: none; gap: 3rem; align-items: center; }
.nav-link {
    color: var(--text-secondary);
    font-weight: 500; font-size: 0.95rem;
    padding: 0.5rem 0; position: relative;
    transition: var(--transition-normal);
    text-decoration: none; white-space: nowrap;
}
.nav-link::after {
    content: ''; position: absolute;
    bottom: -4px; left: 0; width: 0; height: 2px;
    background: var(--accent-gradient);
    transition: var(--transition-normal);
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { font-weight: 600; }
.nav-link.active::after { background: var(--accent-purple); box-shadow: 0 0 15px var(--accent-glow); }

.location-selector {
    display: flex; align-items: center; gap: 8px;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer; transition: var(--transition-normal);
    color: var(--text-secondary); font-size: 0.9rem;
}
.location-selector:hover { border-color: var(--accent-purple); box-shadow: 0 0 20px var(--accent-glow); color: var(--text-primary); }
.location-icon { color: var(--accent-purple); font-size: 14px; }
.location-dropdown { background: transparent; border: none; color: var(--text-secondary); font-family: inherit; font-size: 0.9rem; cursor: pointer; outline: none; }
.location-dropdown option { background: var(--bg-card); color: var(--text-primary); }

.profile-menu-wrapper { position: relative; }
.profile-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: 2px solid rgba(139,92,246,0.4);
    color: white; font-size: 13px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
}
.profile-btn:hover { transform: scale(1.1); box-shadow: 0 0 16px rgba(139,92,246,0.5); }

.profile-dropdown {
    position: absolute; top: 48px; right: 0;
    background: #1a1a25;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 8px; min-width: 180px;
    display: none; z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.profile-dropdown .user-name {
    padding: 8px 12px; color: #a0a0b0; font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.profile-dropdown button {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 9px 12px; border-radius: 8px; font-size: 14px;
    background: none; border: none; cursor: pointer; transition: background 0.2s;
    text-align: left; color: #ef4444; font-family: inherit;
}
.profile-dropdown button:hover { background: rgba(239,68,68,0.1); }

.login-nav-btn {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white; padding: 8px 18px; border-radius: 8px;
    font-size: 14px; font-weight: 600; text-decoration: none;
    transition: all 0.3s; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
}
.login-nav-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(139,92,246,0.4); }

.sidebar-toggle-btn {
    display: none; width: 36px; height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text-secondary);
    font-size: 16px; cursor: pointer;
    align-items: center; justify-content: center;
    transition: all 0.2s ease; margin-right: 6px; flex-shrink: 0;
}
.sidebar-toggle-btn:hover { background: var(--accent-purple); color: white; border-color: var(--accent-purple); }

.mobile-menu-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px; z-index: 1100;
}
.mobile-menu-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s; }

.mobile-menu {
    display: none; position: fixed; top: 80px; left: 0; right: 0;
    background: rgba(10,10,15,0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 999; padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.mobile-menu.open { display: block; }

.mobile-nav-links { list-style: none; padding: 0; margin: 0; }
.mobile-nav-links li { margin-bottom: 4px; }
.mobile-nav-links a {
    display: block; padding: 0.85rem 1rem;
    color: #a0a0b0; text-decoration: none;
    border-radius: 10px; font-size: 1rem; font-weight: 500; transition: all 0.2s;
}
.mobile-nav-links a:hover { background: rgba(139,92,246,0.15); color: #fff; }

.mobile-auth { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.mobile-welcome { color: #a0a0b0; font-size: 13px; margin-bottom: 8px; }
.mobile-logout-btn {
    background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444; padding: 8px 16px; border-radius: 8px; cursor: pointer;
    font-size: 14px; width: 100%; display: flex; align-items: center;
    justify-content: center; gap: 8px; transition: all 0.3s ease; font-family: inherit;
}
.mobile-logout-btn:hover { background: rgba(239,68,68,0.25); }
.mobile-login-btn {
    display: block; text-align: center;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white; padding: 10px; border-radius: 8px;
    font-size: 14px; font-weight: 600; text-decoration: none; transition: all 0.3s ease;
}
.mobile-login-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(139,92,246,0.4); }

@media (max-width: 768px) {
    .nav-center, .nav-right { display: none !important; }
    .mobile-menu-toggle { display: flex !important; }
    .sidebar-toggle-btn  { display: flex !important; }
    .nav-left { margin-top: 0 !important; }
}


.main-container {
    display: flex;
    height: 100vh;
    padding-top: 80px;
}


.sidebar {
    width: 300px;
    min-width: 180px;
    max-width: 500px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0s, padding 0.2s;
    position: relative;
    flex-shrink: 0;
}

#sidebarCollapseBtn {
    position: absolute;
    top: 50%;
    right: -13px;
    transform: translateY(-50%);
    width: 22px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.35);
    font-size: 10px;
    z-index: 200;
    transition: all 0.2s;
}
#sidebarCollapseBtn:hover { background: rgba(139,92,246,0.2); color: #a78bfa; }

#sidebarResizer {
    width: 5px;
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    transition: background 0.2s;
}
#sidebarResizer:hover,
#sidebarResizer.resizing { background: rgba(139,92,246,0.2); }
#sidebarResizer::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 2px; height: 36px;
    border-radius: 2px;
    background: rgba(139,92,246,0.6);
    opacity: 0; transition: opacity 0.2s;
}
#sidebarResizer:hover::before,
#sidebarResizer.resizing::before { opacity: 1; }

.new-chat-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; width: 100%; padding: 14px 20px;
    background: var(--accent-gradient);
    color: white; border: none;
    border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: 0 4px 16px var(--accent-glow);
    margin-bottom: 24px;
}
.new-chat-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--accent-glow-strong); }
.new-chat-btn svg { stroke: white; }

.chat-history { flex: 1; }
.history-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin-bottom: 16px; padding-left: 12px;
}
.history-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.history-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px; border-radius: var(--radius-md);
    cursor: pointer; font-size: 14px; color: var(--text-secondary);
    transition: all 0.2s ease;
    background: transparent; border: 1px solid transparent;
    position: relative; overflow: hidden;
}
.history-item:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-color); }
.history-item.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.15);
}

.history-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; height: 60%;
    width: 3px;
    background: linear-gradient(180deg, #8b5cf6, #6366f1);
    border-radius: 0 3px 3px 0;
}

.history-item.active span {
    color: #ffffff;
    font-weight: 600;
}
.history-item span {
    flex: 1; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    padding-right: 8px;
}

.delete-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    opacity: 0; transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    color: var(--text-muted); flex-shrink: 0;
}
.delete-btn svg { width: 18px; height: 18px; stroke-width: 2; transition: all 0.2s ease; }
.history-item:hover .delete-btn { opacity: 1; transform: translateX(0); }
.delete-btn:hover { background: rgba(239,68,68,0.15); color: var(--error); transform: scale(1.1); }
.delete-btn:hover svg { transform: rotate(12deg); }


.chat-container {
    flex: 1;
    display: flex; flex-direction: column;
    background: var(--bg-primary);
    position: relative; min-width: 0;
}

.chat-messages {
    flex: 1; overflow-y: auto;
    padding: 32px 48px;
    display: flex; flex-direction: column;
    gap: 24px;
}


.message {
    display: flex; gap: 16px;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}
@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

.ai-avatar {
    width: 40px; height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px var(--accent-glow);
    font-weight: 700; font-size: 11px; color: white;
    letter-spacing: -0.5px;
}

.message-content {
    background: var(--bg-card);
    padding: 16px 20px; border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    font-size: 15px; line-height: 1.6;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
}
.user-message .message-content {
    background: var(--accent-purple);
    border-color: transparent; color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
    position: relative;
}

.message-sender {
    font-size: 12px; font-weight: 600;
    color: var(--accent-purple-light);
    margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.user-message .message-sender { color: rgba(255,255,255,0.8); text-align: right; }


.edit-msg-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 4px;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
}
.edit-msg-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
}

.inline-edit-textarea {
    width: 100%;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 8px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 10px;
    resize: vertical;
    outline: none;
    line-height: 1.6;
    margin-top: 8px;
    transition: border-color 0.2s ease;
}
.inline-edit-textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}


.ats-score-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(99,102,241,0.06) 100%);
    border: 1px solid rgba(139,92,246,0.28);
    border-radius: 14px;
    padding: 16px 20px;
    margin: 8px 0 12px;
}

.ats-ring-wrap {
    position: relative;
    width: 96px; height: 96px;
    flex-shrink: 0;
}
.ats-ring-svg { transform: rotate(-90deg); width: 96px; height: 96px; }
.ats-ring-bg-c { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 9; }
.ats-ring-prog {
    fill: none; stroke-linecap: round; stroke-width: 9;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1);
}
.ats-ring-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.ats-ring-number {
    font-size: 22px; font-weight: 800;
    background: linear-gradient(135deg, #8b5cf6, #6366f1, #ec4899);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    line-height: 1;
}
.ats-ring-denom { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 1px; }
.ats-card-info { flex: 1; min-width: 0; }
.ats-card-title {
    font-size: 13px; font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 2px;
}
.ats-card-grade { font-size: 15px; font-weight: 700; margin-bottom: 10px; line-height: 1.2; }
.ats-bar-wrap {
    height: 5px; background: rgba(255,255,255,0.07);
    border-radius: 99px; overflow: hidden; margin-bottom: 8px;
}
.ats-bar-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, #8b5cf6, #6366f1, #ec4899);
    width: 0%; transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
}
.ats-card-tip { font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.5; }


.agent-workflow-message {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px; max-width: 400px;
}
.agent-step {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; opacity: 0.5; transition: all 0.3s ease;
}
.agent-step.active   { opacity: 1; }
.agent-step.completed { opacity: 0.7; }
.agent-step-icon {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.3s ease;
}
.agent-step.active .agent-step-icon   { background: var(--accent-purple); animation: pulseIcon 2s infinite; }
.agent-step.completed .agent-step-icon { background: var(--success); }
.agent-step-icon svg { width: 14px; height: 14px; stroke-width: 2.5; }
.agent-step-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.agent-step.active .agent-step-text { color: var(--text-primary); }
.agent-connector {
    width: 2px; height: 20px; background: var(--bg-tertiary);
    margin-left: 13px; position: relative; overflow: hidden;
}
.agent-connector::after {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 0; background: var(--accent-purple);
    transition: height 0.5s ease;
}
.agent-connector.active::after { height: 100%; }

@keyframes pulseIcon {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50%       { box-shadow: 0 0 0 8px rgba(139,92,246,0); }
}


.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing-indicator span {
    width: 8px; height: 8px; background: var(--accent-purple);
    border-radius: 50%; animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40%           { transform: scale(1); opacity: 1; }
}


.message-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: var(--radius-md);
    font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    border: none; font-family: inherit;
}
.action-btn.preview  { background: var(--accent-gradient); color: white; box-shadow: 0 4px 12px var(--accent-glow); }
.action-btn.preview:hover { transform: translateY(-1px); box-shadow: 0 6px 16px var(--accent-glow-strong); }
.action-btn.download { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border-color); }
.action-btn.download:hover { background: var(--bg-tertiary); border-color: var(--accent-purple); color: var(--accent-purple-light); }
.action-btn.edit { background: var(--success); color: white; }
.action-btn.edit:hover { background: #059669; transform: translateY(-1px); }


.resume-generated-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px; margin-top: 16px;
}
.resume-generated-header {
    text-align: center; margin-bottom: 16px;
    padding-bottom: 16px; border-bottom: 1px solid var(--border-color);
}
.resume-generated-title  { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.resume-generated-subtitle { font-size: 13px; color: var(--text-muted); }


.template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
    max-width: 380px;
}

.template-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.template-card:hover {
    border-color: var(--accent-purple);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}
.template-card.selected {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

.template-preview {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 12px 10px;
    margin-bottom: 10px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-preview-inner { width: 100%; }

.template-preview-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tpl-line {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}
.tpl-line-name {
    width: 55%;
    margin: 0 auto 8px;
    height: 7px;
    background: rgba(139, 92, 246, 0.35);
}
.tpl-line-long   { width: 100%; }
.tpl-line-medium { width: 72%; }
.tpl-line-short  { width: 48%; }

.template-card:hover .tpl-line-name {
    background: rgba(139, 92, 246, 0.65);
}

.template-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
    letter-spacing: 0.3px;
}
.template-card:hover .template-name {
    color: var(--accent-purple-light);
}


.upload-menu {
    position: absolute; bottom: 100px; left: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease; z-index: 100;
}
.upload-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }
.upload-option {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 12px 16px;
    background: transparent; border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.upload-option:hover { background: var(--bg-hover); color: var(--accent-purple); }
.upload-option svg { color: var(--text-muted); transition: color 0.2s ease; }
.upload-option:hover svg { color: var(--accent-purple); }


.chat-input-container {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 48px 32px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}
.attach-btn {
    width: 44px; height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary);
    transition: all 0.2s ease; flex-shrink: 0;
}
.attach-btn:hover { background: var(--bg-hover); color: var(--accent-purple); border-color: var(--accent-purple); transform: scale(1.05); box-shadow: 0 0 15px var(--accent-glow); }
.attach-btn.active { background: var(--accent-purple); color: white; border-color: var(--accent-purple); transform: rotate(45deg); }
.input-wrapper { flex: 1; position: relative; }
.message-input {
    width: 100%; padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary); font-size: 15px;
    font-family: inherit; outline: none; transition: all 0.2s ease;
}
.message-input::placeholder { color: var(--text-muted); }
.message-input:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139,92,246,0.2); }
.send-btn {
    width: 44px; height: 44px;
    background: var(--accent-gradient);
    border: none; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: white;
    transition: all 0.2s ease; flex-shrink: 0;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.send-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 24px var(--accent-glow-strong); }
.send-btn:active { transform: translateY(0); }
.send-btn svg { stroke: white; }


.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease; padding: 24px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 800px; max-height: 95vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95); transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content { transform: scale(1); }
.delete-modal { max-width: 420px; }
.delete-text { font-size: 15px; color: var(--text-secondary); line-height: 1.6; text-align: center; padding: 8px 0; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border-color);
}
.modal-header h2 { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.close-btn {
    width: 36px; height: 36px;
    background: var(--bg-hover); border: none;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary); transition: all 0.2s ease;
}
.close-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); transform: rotate(90deg); }
.modal-body   { flex: 1; overflow: hidden; padding: 0; }
.modal-footer {
    display: flex; gap: 12px; justify-content: flex-end;
    padding: 20px 24px; border-top: 1px solid var(--border-color);
}
#pdfViewer {
    width: 100%; height: 85vh; border: none;
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    border: none; font-family: inherit;
}
.btn-primary   { background: var(--accent-gradient); color: white; box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--accent-glow-strong); }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-tertiary); border-color: var(--accent-purple); color: var(--accent-purple-light); }
.btn-danger    { background: var(--error); color: white; }
.btn-danger:hover { background: var(--danger-hover); transform: translateY(-2px); }


.welcome-container { display: flex; flex-direction: column; gap: 16px; animation: slideUp 0.6s ease; }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.welcome-title {
    font-size: 24px; font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.welcome-subtitle { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }
.upload-prompt {
    display: flex; align-items: center; gap: 12px;
    margin-top: 8px; padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px dashed var(--accent-purple);
    cursor: pointer; transition: all 0.3s ease;
}
.upload-prompt:hover { background: var(--bg-hover); border-style: solid; box-shadow: 0 0 20px var(--accent-glow); }
.upload-prompt svg { color: var(--accent-purple); }
.upload-prompt-text { font-size: 14px; color: var(--text-primary); font-weight: 500; }


.fade-in-text {
    animation: fadeInText 0.4s ease forwards;
}
@keyframes fadeInText {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}


::-webkit-scrollbar       { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-purple-dark); }


@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: 0; top: 60px; bottom: 0;
        transform: translateX(-100%); z-index: 1050;
        width: 280px !important; min-width: 280px !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.6);
    }
    .sidebar.active { transform: translateX(0); }
    #sidebarCollapseBtn { display: none !important; }
    .chat-messages  { padding: 16px; }
    .message        { max-width: 95%; }
    .ats-score-card { flex-direction: column; text-align: center; }
    .chat-input-container { padding: 16px; }
    .upload-menu    { left: 16px; bottom: 80px; }
    .modal-content  { max-width: 100%; max-height: 95vh; margin: 16px; }
    .modal-footer   { flex-direction: column; }
    .btn            { width: 100%; justify-content: center; }
    .delete-btn     { opacity: 1; transform: none; }
    .popup-content  { padding: 32px 24px; }
    .popup-buttons  { flex-direction: column; }
    .popup-buttons a { width: 100%; justify-content: center; }
    .template-grid  { grid-template-columns: 1fr 1fr; gap: 8px; max-width: 100%; }
    .template-preview { min-height: 70px; padding: 8px; }
    .template-name  { font-size: 12px; }
}

@media (max-width: 1024px) {
    .sidebar { width: 260px; }
    .chat-messages { padding: 24px 32px; }
    .chat-input-container { padding: 20px 32px 24px; }
}


.hidden { display: none !important; }
.glow   { box-shadow: 0 0 20px var(--accent-glow); }
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}


.chat-disclaimer {
    text-align: center; font-size: 11.5px;
    color: rgba(255,255,255,0.32);
    padding: 5px 16px 12px; margin: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 400; letter-spacing: 0.01em;
    user-select: none;
}


.footer {
    padding: 12px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    position: relative;
}
.footer-grid {
    display: flex; justify-content: space-between;
    align-items: center; padding: 0 32px; margin-bottom: 10px;
}
.footer-logo {
    font-size: 1rem; font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 2px; display: inline-block;
}
.footer-tagline { color: var(--text-muted); font-size: 0.72rem; line-height: 1.3; max-width: 240px; }
.footer-social  { display: flex; gap: 8px; }
.social-link {
    width: 30px; height: 30px; background: var(--bg-card);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.85rem;
    transition: var(--transition-normal);
    border: 1px solid var(--border-color); text-decoration: none;
}
.social-link:hover { background: var(--accent-gradient); color: white; border-color: transparent; transform: translateY(-1px); }
.footer-policy-row {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 6px 0 4px;
}
.footer-policy-link { color: var(--text-muted); font-size: 0.72rem; text-decoration: none; transition: color 0.2s ease; }
.footer-policy-link:hover { color: var(--accent-purple-light); }
.footer-dot { color: var(--text-muted); font-size: 0.65rem; opacity: 0.4; }
.footer-bottom { text-align: center; padding-top: 6px; border-top: 1px solid var(--border-color); margin-top: 4px; }
.copyright { color: var(--text-muted); font-size: 0.72rem; }
.footer-glow {
    position: absolute; bottom: -60px; left: 50%;
    transform: translateX(-50%);
    width: 400px; height: 120px;
    background: var(--accent-purple);
    border-radius: 50%; filter: blur(80px);
    opacity: 0.08; pointer-events: none;
}
.footer-logo-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.footer-logo-img {
    height: 24px;
    width: auto;
    margin-top: -18px;
    margin-right: -12px;
    display: block;
}
.footer-logo-text {
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ec4899, #8b5cf6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    font-family: 'Times New Roman', Times, serif;
}