/* OneShotCV - Wikipedia-style CSS */

:root {
    --bg: #ffffff;
    --text: #202122;
    --border: #a2a9b1;
    --link: #0645ad;
    --link-visited: #0b0080;
    --gray-light: #f8f9fa;
    --gray-medium: #eaecf0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Liberation Sans", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    text-decoration: underline;
}

/* Landing Page */
.landing {
    max-width: 980px;
    margin: 0 auto;
    padding: 40px 20px;
}

.landing-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.landing-header h1 {
    font-family: "Linux Libertine", Georgia, Times, serif;
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text);
}

.landing-header .tagline {
    color: #54595d;
    font-size: 14px;
}

.landing-content {
    font-family: Georgia, Times, serif;
    font-size: 14px;
    line-height: 1.65;
}

.landing-content h2 {
    font-family: "Linux Libertine", Georgia, Times, serif;
    font-size: 21px;
    font-weight: 400;
    margin: 30px 0 12px;
    border-bottom: 1px solid var(--gray-medium);
    padding-bottom: 2px;
}

.landing-content p {
    margin-bottom: 14px;
}

.landing-content ul {
    margin-left: 20px;
    margin-bottom: 14px;
}

.cta-section {
    margin: 40px 0;
    text-align: center;
}

/* Examples Section */
.examples-section {
    margin: 40px 0;
    padding: 24px;
    background: var(--gray-light);
    border: 1px solid var(--border);
}

.examples-section h3 {
    font-family: "Linux Libertine", Georgia, Times, serif;
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 20px 0;
    text-align: center;
}

.examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.example-item {
    text-align: center;
}

.example-item img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: zoom-in;
}

.example-item img:hover {
    transform: scale(1.20);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.example-caption {
    margin-top: 8px;
    font-weight: 600;
    font-size: 13px;
}

.examples-note {
    text-align: center;
    font-size: 13px;
    color: #54595d;
    margin: 0;
}

@media (max-width: 768px) {
    .examples-grid {
        grid-template-columns: 1fr;
    }
}

.cta-section {
    margin: 40px 0;
    text-align: center;
}

.btn-cta {
    display: inline-block;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 32px;
    background: #36c;
    color: #fff !important;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-cta:visited {
    color: #fff !important;
}

.btn-cta:hover {
    background: #2a4b8d;
    text-decoration: none;
    color: #fff !important;
}

/* Builder Page */
.builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    overflow: hidden;
}

.form-section {
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
    border-right: 1px solid var(--border);
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.home-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
}

.home-link:hover {
    text-decoration: underline;
}

.btn-reset {
    background: white;
    border: 1px solid #c00;
    color: #c00;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

.btn-reset:hover {
    background: #fee;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
}

.btn-icon:hover {
    background: var(--gray-light);
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    background: white;
    border: 1px solid var(--border);
    cursor: pointer;
}

.btn-small:hover {
    background: var(--gray-light);
}

/* Job Description Section */
.jd-section {
    margin-bottom: 12px;
}

.jd-section details {
    border: 1px solid var(--border);
    background: #fffef5;
}

.jd-section summary {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #54595d;
}

.jd-section summary:hover {
    background: #fefcf0;
}

.jd-section textarea {
    width: 100%;
    border: none;
    border-top: 1px solid var(--border);
    padding: 12px;
    font-size: 12px;
    resize: vertical;
    min-height: 80px;
}

/* Stats Bar (Word Count & ATS Score) */
.stats-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--gray-light);
    border: 1px solid var(--border);
    border-bottom: none;
    font-size: 12px;
    color: #54595d;
}

.stats-bar .ats-good {
    color: #14866d;
    font-weight: 600;
}

.stats-bar .ats-ok {
    color: #b58105;
    font-weight: 600;
}

.stats-bar .ats-poor {
    color: #c00;
    font-weight: 600;
}

/* Keyword Feedback */
.keyword-feedback {
    padding: 8px 12px;
    background: var(--gray-light);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    font-size: 11px;
    line-height: 1.6;
    max-height: 80px;
    overflow-y: auto;
}

.keyword-feedback:empty {
    display: none;
}

.keyword-match {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 2px;
}

.keyword-missing {
    display: inline-block;
    background: #f8d7da;
    color: #721c24;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 2px;
}

.ats-disclaimer {
    font-size: 0.75rem;
    color: #72777d;
    background: #f8f9fa;
    border-left: 3px solid #fc3;
    padding: 6px 10px;
    margin: 8px 0 12px 0;
    line-height: 1.4;
}

.ats-disclaimer strong {
    color: #54595d;
}

.sample-notice {
    font-size: 0.85rem;
    color: #202122;
    background: #d4edff;
    border: 1px solid #a2c8e8;
    border-radius: 3px;
    padding: 10px 12px;
    margin: 12px 0;
    line-height: 1.4;
    text-align: center;
}

.sample-notice strong {
    font-weight: 600;
}

.btn-link {
    background: none;
    border: none;
    color: #0645ad;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    padding: 0;
    margin: 0 4px;
}

.btn-link:hover {
    color: #0b0080;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 4px;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin: 0 0 16px 0;
}

.shortcuts-table {
    width: 100%;
    margin-bottom: 16px;
}

.shortcuts-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.shortcuts-table td:first-child {
    font-family: monospace;
}

kbd {
    background: var(--gray-light);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.form-section h2 {
    font-family: "Linux Libertine", Georgia, Times, serif;
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--gray-light);
    border: 1px solid var(--border);
    border-bottom: none;
    margin-right: -1px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

.tab-btn.active {
    background: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}

.tab-btn:hover:not(.active) {
    background: #eee;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section containers */
.section-container {
    border: 1px solid var(--border);
    margin-bottom: 16px;
    background: white;
    padding-bottom: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gray-light);
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.section-title-input {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid var(--border);
    background: white;
    padding: 6px 10px;
    min-width: 0;
}

.section-title-input:focus {
    outline: none;
    border-color: var(--accent);
}

.section-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.section-entries {
    padding: 16px;
}

.entry-item {
    background: var(--gray-light);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.entry-item:last-child {
    margin-bottom: 0;
}

.btn-add-entry {
    display: block;
    width: auto;
    margin: 12px 16px 0 16px;
    background: white;
    border: 1px dashed var(--border);
    padding: 10px 24px;
    color: #666;
    text-align: center;
}

.btn-add-entry:hover {
    background: var(--gray-light);
    border-style: solid;
}

.preview-section {
    overflow-y: auto;
    padding: 0;
    background-color: #525659;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zoom-controls {
    position: sticky;
    top: 0;
    width: 100%;
    background: #404040;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
    border-bottom: 1px solid #333;
}

.zoom-controls button {
    background: #525659;
    border: 1px solid #666;
    color: white;
    padding: 4px 12px;
    font-size: 14px;
    cursor: pointer;
}

.zoom-controls button:hover {
    background: #666;
}

.zoom-controls span {
    color: white;
    font-size: 13px;
    min-width: 50px;
    text-align: center;
}

.preview-pages {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.preview-page {
    width: 8.5in;
    min-height: 11in;
    background: white;
    padding: 0.75in;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-family: Georgia, Times, serif;
    font-size: 11pt;
    line-height: 1.4;
    box-sizing: border-box;
    transform-origin: top center;
    transition: transform 0.2s ease;
    position: relative;
}

/* Smart page break handling - prevent awkward splits */
.resume-section {
    page-break-inside: avoid;
    break-inside: avoid;
}

.resume-entry {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Keep section headers with their first entry */
.resume-section h2 {
    page-break-after: avoid;
    break-after: avoid;
}

/* Page number indicator for multi-page resumes */
.page-number {
    position: absolute;
    bottom: 0.5in;
    right: 0.75in;
    font-size: 9pt;
    color: #999;
    font-style: italic;
}

/* Page length tip */
.page-length-tip {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 16px;
    margin-top: 12px;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    max-width: 8.5in;
}

/* Contact icons in preview */
.contact-icon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
    margin-right: 3px;
    display: inline-block;
}

/* Form styling */
fieldset {
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 20px;
    background: var(--gray-light);
}

legend {
    font-weight: 600;
    padding: 0 8px;
    font-size: 15px;
}

input, textarea {
    width: 100%;
    padding: 6px 8px;
    margin: 4px 0 12px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
    background: white;
}

input:focus, textarea:focus {
    outline: 2px solid #36c;
    outline-offset: 0;
}

label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    font-size: 13px;
}

/* Buttons */
button {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    background: white;
    font-weight: 600;
}

button:hover {
    background: var(--gray-light);
}

.btn-add {
    width: 100%;
    margin: 10px 0;
    background: var(--gray-light);
}

.btn-remove {
    background: #fee;
    border-color: #fcc;
    color: #c00;
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-remove:hover {
    background: #fdd;
}

.export-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 50%;
    padding: 16px 20px;
    background: white;
    border-top: 2px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 100;
}

.btn-primary {
    background: #36c;
    color: white;
    border-color: #36c;
    padding: 10px 24px;
    font-size: 15px;
}

.btn-primary:hover {
    background: #2a4b8d;
}

.btn-secondary {
    background: white;
    color: #54595d;
    padding: 10px 24px;
    font-size: 15px;
}

.btn-secondary:hover {
    background: var(--gray-light);
}

/* Section entries */
.section-entry {
    background: white;
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

/* Rich text editor */
.editor-toolbar {
    display: flex;
    gap: 4px;
    margin: 6px 0;
    padding: 6px;
    background: var(--gray-light);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 4px 8px;
    font-size: 13px;
    min-width: 32px;
    background: white;
}

.editor-toolbar button:hover {
    background: #e8e8e8;
}

.editor-toolbar button.active {
    background: #d0d0d0;
}

.editor-content {
    min-height: 100px;
    padding: 8px;
    border: 1px solid var(--border);
    background: white;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
}

.editor-content ul,
.editor-content ol {
    margin: 4px 0 4px 20px;
    padding: 0;
    list-style-position: outside;
}

.editor-content li {
    margin: 2px 0;
}

.editor-content:focus {
    border-color: #36c;
    box-shadow: 0 0 0 2px rgba(51, 102, 204, 0.1);
}

.section-entry h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: #54595d;
}

footer {
    max-width: 980px;
    margin: 40px auto 0;
    padding: 20px 20px 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: #54595d;
    font-size: 12px;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-small {
    font-size: 11px;
    margin-top: 8px;
    color: #72777d;
}

/* Legal pages */
.legal-page {
    font-size: 15px;
    line-height: 1.7;
}

.legal-page h2 {
    margin-top: 28px;
}

.legal-page ul {
    margin: 12px 0 12px 24px;
}

.legal-page li {
    margin-bottom: 6px;
}

.highlight-box {
    background: #f8f9fa;
    border-left: 4px solid var(--accent);
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 14px;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .builder {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .form-section {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .export-section {
        position: relative;
        right: 0;
        flex-direction: column;
    }
}

/* Mobile warning */
.mobile-warning {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 12px 16px;
    margin: 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

@media (max-width: 768px) {
    .mobile-warning {
        display: block;
    }
}

/* Print styles */
@media print {
    .form-section,
    .zoom-controls,
    .export-section,
    .mobile-warning {
        display: none !important;
    }
    
    .builder {
        display: block;
    }
    
    .preview-section {
        background: white;
        overflow: visible;
    }
    
    .preview-page {
        transform: none !important;
        box-shadow: none;
        margin: 0;
        padding: 0.5in;
    }
    
    /* Prevent awkward page splits when printing/exporting */
    .resume-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .resume-entry {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .resume-section h2 {
        page-break-after: avoid;
        break-after: avoid;
    }
    
    .skills-entry {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* Drag and drop */
.section-container.dragging {
    opacity: 0.5;
    border: 2px dashed var(--link);
}

.section-controls {
    display: flex;
    gap: 4px;
}

.btn-move {
    background: var(--gray-light);
    border: 1px solid var(--border);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    color: var(--text);
    transition: all 0.2s;
}

.btn-move:hover {
    background: var(--link);
    color: white;
    border-color: var(--link);
}

.btn-move:active {
    transform: scale(0.95);
}

.btn-move:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--gray-light);
    color: #999;
}

/* Template selector */
.template-selector {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--gray-light);
    border: 1px solid var(--border);
}

.template-selector label {
    margin-right: 16px;
    font-weight: normal;
    cursor: pointer;
}

.template-selector input[type="radio"] {
    margin-right: 4px;
}

/* Save indicator */
.save-indicator {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.save-indicator.show {
    opacity: 1;
}

/* Input validation */
input:invalid {
    border-color: #dc3545;
}

input:valid {
    border-color: var(--border);
}

.validation-hint {
    font-size: 11px;
    color: #dc3545;
    margin-top: -8px;
    margin-bottom: 8px;
    display: none;
}

input:invalid + .validation-hint {
    display: block;
}
