/* ============================================
   RESUMEWHIP DESIGN SYSTEM
   Carried over from the Gradio app's custom_css —
   same variables, same components, same brand.
   ============================================ */

   :root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #34d399;
    --accent-hover: #10b981;
    --accent-light: #6ee7b7;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: #dfe8f1;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.page-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* ============================================
   HEADER (unchanged from Gradio version)
   ============================================ */

.header-container {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 40px 20px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.header-container h1 {
    color: white;
    font-size: 2.5em;
    font-weight: 800;
    margin: 0 0 10px 0;
    text-align: center;
}

.logo-link {
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.logo-link:hover h1 {
    opacity: 0.9;
}

.header-container h2 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.3em;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

.header-container h3 {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1em;
    font-weight: 400;
    margin: 15px 0 0 0;
    text-align: center;
}

/* ============================================
   STATUS / CREDITS BADGE (matches backend HTML)
   ============================================ */

.status-badge {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.status-badge.premium {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 50%, var(--accent-hover) 100%);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3);
}

.status-badge.free {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

/* ============================================
   FORM CARD
   ============================================ */

.form-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.form-card h3 {
    margin-top: 0;
    color: var(--text-primary);
}

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

.field-group label {
    display: block;
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.field-group input[type="email"],
.field-group input[type="text"],
.field-group textarea,
.field-group select {
    width: 100%;
    border: 2px solid var(--border);
    background-color: var(--bg-primary);
    font-size: 1em;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.field-group input[type="email"]:focus,
.field-group input[type="text"]:focus,
.field-group textarea:focus,
.field-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.field-group textarea {
    resize: vertical;
    min-height: 140px;
}

/* Custom file upload dropzone — this is the part Gradio never let us fully brand */
.file-drop {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.file-drop:hover,
.file-drop.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
}

.file-drop .file-drop-label {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.file-drop .file-drop-filename {
    color: var(--primary);
    font-weight: 600;
    margin-top: 6px;
}

.file-drop input[type="file"] {
    display: none;
}

/* ============================================
   BUTTONS (unchanged classes, plain <button> now)
   ============================================ */

.cta-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 16px 32px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    width: 100%;
}

.cta-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--secondary) 100%);
}

.cta-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.download-btn {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 50%, var(--accent-hover) 100%);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 14px 28px;
    font-size: 1.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.download-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 211, 153, 0.4);
}

/* ============================================
   RESUME + DAY IN THE LIFE SIDE-BY-SIDE LAYOUT
   ============================================ */

.resume-with-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.resume-with-sidebar .result-card {
    margin-bottom: 0;
}

.sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.sidebar-panel .cta-btn {
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .resume-with-sidebar {
        grid-template-columns: 1fr;
    }
    .sidebar-stack {
        position: static;
    }
}

/* ============================================
   RESULTS
   ============================================ */

.results-section {
    display: none;
}

.results-section.visible {
    display: block;
}

.result-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.result-card h3 {
    margin-top: 0;
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.result-card-header h3 {
    margin: 0;
}

.edit-toggle-btn {
    background: var(--accent);
    color: white;
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.edit-toggle-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.resume-edit-textarea {
    width: 100%;
    min-height: 420px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 16px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    color: var(--text-primary);
    resize: vertical;
}

.resume-edit-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.optimized-resume-body {
    line-height: 1.7;
    color: var(--text-primary);
}

.optimized-resume-body h1,
.optimized-resume-body h2,
.optimized-resume-body h3 {
    color: var(--text-primary);
}

.optimized-resume-body ul {
    padding-left: 22px;
}

.suggestions-body {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: 8px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   PRIVACY BANNER — "Clear My Info"
   ============================================ */

.privacy-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.privacy-banner-text {
    color: #78350f;
    font-weight: 600;
    font-size: 0.95em;
}

.privacy-banner-text span {
    font-weight: 400;
    display: block;
    font-size: 0.9em;
    margin-top: 2px;
}

.clear-info-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.clear-info-btn:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.clear-info-btn:disabled {
    background: #10b981;
    cursor: default;
}

/* ============================================
   FOOTER — "NEED HELP" LINK
   ============================================ */

.footer-links-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    margin-top: 32px;
    border-top: 1px solid var(--border);
}

.footer-help-link {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

/* Primary CTA — Need Another Tool */
.footer-help-link.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
}

.footer-help-link.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    text-decoration: none;
}

/* Secondary CTA — YouTube walkthrough */
.footer-help-link.secondary {
    background: var(--bg-primary);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.footer-help-link.secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2);
    text-decoration: none;
}

/* ============================================
   COLLAPSIBLE "GET STARTED" SECTION
   ============================================ */

.collapsible-toggle {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px 14px;
    margin: -10px -14px;
    border-radius: 10px;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s ease;
}

.collapsible-toggle:hover {
    background: var(--bg-secondary);
}

.collapsible-toggle h3 {
    margin: 0;
}

.collapsible-chevron {
    font-size: 0.85em;
    font-weight: 700;
    color: white;
    background: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.collapsible-chevron.expanded {
    background: var(--primary-hover);
}

.collapsible-toggle:hover .collapsible-chevron {
    transform: scale(1.05);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

.collapsible-content.expanded {
    max-height: 3000px;
    opacity: 1;
}

/* ============================================
   INTERVIEW PREP — QUESTION CARDS
   ============================================ */

.interview-question-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid var(--border);
    animation: fadeInRow 0.3s ease;
}

.interview-question-header {
    margin-bottom: 10px;
}

.difficulty-badge {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
}

/* Green → amber → red as difficulty climbs from warm-up to curveball */
.difficulty-1, .difficulty-2 { background: #10b981; }
.difficulty-3, .difficulty-4 { background: #3b82f6; }
.difficulty-5, .difficulty-6 { background: #f59e0b; }
.difficulty-7, .difficulty-8 { background: #f97316; }
.difficulty-9 { background: #ef4444; }

.interview-question-text {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.interview-coaching-tip {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9em;
    color: var(--text-primary);
    line-height: 1.5;
}

.faq-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-question {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.how-to-steps li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.how-to-steps li:last-child {
    margin-bottom: 0;
}

.rw-logo{display:inline-flex;align-items:center;gap:10px;text-decoration:none;
  font-family:'Outfit',Helvetica,Arial,sans-serif}
.rw-mark{width:32px;height:32px;border-radius:50%;background:#6366f1;flex:none;
  display:flex;align-items:center;justify-content:center}
.rw-mark b{font-size:14px;font-weight:800;color:#fff;letter-spacing:-.07em;line-height:1}
.rw-mark b + b{color:#34d399;letter-spacing:-.05em}
.rw-word{font-size:15px;font-weight:800;color:#312e81;letter-spacing:-.02em;line-height:1}
.rw-logo.on-dark .rw-word{color:#fff}

.rw-logo.lg{gap:16px}
.rw-logo.lg .rw-mark{width:64px;height:64px}
.rw-logo.lg .rw-mark b{font-size:28px}
.rw-logo.lg .rw-word{font-size:40px}

.header-container{text-align:center}

.tool-section-heading {
    color: var(--text-primary);
    font-size: 1.3em;
    margin: 32px 0 16px 4px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 8px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.tool-card.premium:hover {
    border-color: var(--accent);
}

.tool-card h3 {
    margin: 8px 0 8px 0;
    color: var(--text-primary);
}

.tool-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.tool-card-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 4px;
}

.tool-card-badge.free {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-hover);
}

.tool-card-badge.premium {
    background: linear-gradient(135deg, #fed7aa 0%, #fb923c 100%);
    color: white;
}

.tool-card-cta {
    display: inline-block;
    font-weight: 600;
    color: white;
    background: var(--primary);
    padding: 10px 18px;
    border-radius: 8px;
    align-self: flex-start;
    transition: all 0.2s ease;
}

.tool-card:hover .tool-card-cta {
    background: var(--primary-hover);
    transform: translateX(2px);
}

.tool-card.premium .tool-card-cta {
    background: var(--accent);
}

.tool-card.premium:hover .tool-card-cta {
    background: var(--accent-hover);
}

/* ============================================
   JOB VALIDATOR CHECKLIST
   ============================================ */

.checklist-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    animation: fadeInRow 0.3s ease;
}

.checklist-row:last-child {
    border-bottom: none;
}

@keyframes fadeInRow {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.checklist-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95em;
}

.checklist-icon.pass {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-hover);
}

.checklist-icon.fail {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.checklist-label {
    font-weight: 600;
    color: var(--text-primary);
}

.checklist-detail {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 2px;
}

/* ============================================
   MESSAGING / ERROR / LOADING STATES
   ============================================ */

.inline-message {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.inline-message.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.inline-message.upgrade {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
}

.inline-message.upgrade a {
    color: white;
    text-decoration: underline;
    font-weight: 700;
}

.boilerplate-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    color: #78350f;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}

.loading-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 12px;
}

.loading-indicator.visible {
    display: flex;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .header-container h1 { font-size: 2em; }
    .form-card, .result-card { padding: 20px; }
}