/* ===== RESUME PAGE - EDITORIAL LUXURY ===== */

:root {
    --font-serif: 'Cormorant Garamond', 'Georgia', serif;
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #1a1816;
        --surface: #252220;
        --text: #e8e4de;
        --text-muted: #9a948e;
        --accent: #e05252;
        --border: #3a3632;
        --white: #1e1c1a;
    }
}

[data-theme="dark"] {
    --bg: #1a1816;
    --surface: #252220;
    --text: #e8e4de;
    --text-muted: #9a948e;
    --accent: #e05252;
    --border: #3a3632;
    --white: #1e1c1a;
}

/* ===== GATE SCREENS ===== */
.resume-gate {
    max-width: 540px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gate-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.gate-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.5;
}

.gate-title {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.gate-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.gate-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.gate-card + .gate-card {
    margin-top: 1.5rem;
}

.gate-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.gate-divider::before,
.gate-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Gate form fields */
.gate-form .form-group {
    margin-bottom: 1rem;
}

.gate-form .form-group:last-of-type {
    margin-bottom: 1.5rem;
}

.gate-form .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    display: block;
}

.gate-form .form-input,
.gate-form .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.gate-form .form-input:focus,
.gate-form .form-textarea:focus {
    outline: none;
    border-color: var(--text);
}

.gate-form .form-input::placeholder,
.gate-form .form-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.gate-form .form-textarea {
    resize: vertical;
    min-height: 80px;
}

.gate-submit {
    width: 100%;
    background: var(--text);
    color: var(--bg);
    padding: 0.85rem 2rem;
    border: none;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    min-height: 44px;
}

.gate-submit:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.gate-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Honeypot */
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ===== OTP INPUT ===== */
.otp-section {
    text-align: center;
}

.otp-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.otp-digit {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.otp-digit::-webkit-inner-spin-button,
.otp-digit::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-digit:focus {
    outline: none;
    border-color: var(--accent);
}

.otp-digit.filled {
    border-color: var(--text);
}

.otp-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.otp-resend {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s;
}

.otp-resend:hover { opacity: 0.7; }

.otp-resend:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ===== STATUS MESSAGES ===== */
.gate-message {
    text-align: center;
    padding: 2rem;
}

.gate-message-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.gate-message-icon.success {
    background: #f0fdf4;
    color: #16a34a;
}

.gate-message-icon.info {
    background: #f0f9ff;
    color: #0ea5e9;
}

.gate-message h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.gate-message p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.gate-form-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Error messages */
.gate-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

.gate-error.visible {
    display: block;
}

/* ===== SCREEN TRANSITIONS ===== */
.resume-screen {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.resume-screen.active {
    display: block;
}

.resume-screen.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESUME SHOWCASE ===== */
.resume-showcase {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem 6rem;
    opacity: 0;
    animation: fadeIn 0.6s ease 0.1s forwards;
}

.resume-bsd {
    text-align: right;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1rem;
    direction: rtl;
}

/* Hero */
.resume-hero {
    text-align: center;
    padding: 2rem 0 3rem;
}

.resume-photo-frame {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.resume-photo {
    width: 260px;
    height: 340px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resume-photo:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
}

.resume-name {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.resume-summary-sm {
    font-size: 0.95rem;
}

.resume-name-sub {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

.resume-summary {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.resume-summary em {
    font-style: italic;
    color: var(--text-muted);
}

/* Section dividers */
.resume-divider {
    width: 60px;
    height: 1px;
    background: var(--accent);
    margin: 2.5rem auto;
}

/* Sections */
.resume-section {
    margin-bottom: 2.5rem;
}

.resume-section-title {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

/* Details grid */
.resume-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem 3rem;
}

.detail-item {}

.detail-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.detail-value {
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
}

.detail-value-rtl {
    direction: rtl;
    unicode-bidi: bidi-override;
}

/* Education timeline */
.resume-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 2.5px;
    top: 20px;
    bottom: -1rem;
    width: 1px;
    background: var(--border);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-title {
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
}

.timeline-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Employment */
.resume-employment {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
}

.resume-employment strong {
    font-weight: 600;
}

/* Family / Parents */
.resume-family-member {
    margin-bottom: 1.5rem;
}

.resume-family-member:last-child {
    margin-bottom: 0;
}

.family-role {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.family-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.family-details {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* References */
.resume-references-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reference-section-gap {
    margin-top: 1.5rem;
}

.reference-group-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.reference-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.reference-item:last-child {
    border-bottom: none;
}

.reference-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.reference-role {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.reference-phone {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s;
}

.reference-phone:hover {
    color: var(--accent);
}

/* ===== ACTION BAR ===== */
.resume-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(244, 241, 235, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.85rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    animation: fadeIn 0.4s ease 0.5s forwards;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .resume-actions {
        background: rgba(26, 24, 22, 0.92);
    }
}

.resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid var(--border);
    text-decoration: none;
    min-height: 40px;
}

.resume-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.resume-btn-print {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.resume-btn-print:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.resume-btn-download {
    background: var(--white);
    color: var(--text);
}

.resume-btn-download:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .resume-gate {
        padding: 2rem 1.5rem;
    }

    .gate-card {
        padding: 1.5rem;
    }

    .otp-digit {
        width: 2.5rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    .resume-showcase {
        padding: 2rem 1.5rem 5rem;
    }

    .resume-photo {
        width: 200px;
        height: 260px;
    }

    .resume-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .reference-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .resume-actions {
        padding: 0.75rem 1rem;
    }

    .resume-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .resume-name {
        font-size: 1.8rem;
    }

    .otp-inputs {
        gap: 0.35rem;
    }

    .otp-digit {
        width: 2.2rem;
        height: 2.8rem;
        font-size: 1.1rem;
    }

    .resume-photo {
        width: 180px;
        height: 235px;
    }
}

/* ===== PRINT STYLESHEET ===== */
@media print {
    /* Hide everything except resume */
    .header,
    .footer,
    .whatsapp-float,
    .resume-actions,
    .resume-gate,
    .resume-screen:not(.screen-showcase) {
        display: none !important;
    }

    /* Reset layout */
    body {
        background: white !important;
        color: #1a1a1a !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    main {
        padding-top: 0 !important;
    }

    .resume-showcase {
        max-width: 100%;
        padding: 0;
        margin: 0;
        opacity: 1 !important;
        animation: none !important;
    }

    /* Photo watermark background */
    .resume-showcase::before {
        content: '';
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 55%;
        aspect-ratio: 3/4;
        background-image: url('/assets/hershi-portrait.jpg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.04;
        z-index: -1;
        pointer-events: none;
    }

    /* Photo in content */
    .resume-photo {
        width: 180px;
        height: 230px;
        border: 1px solid #ccc;
        box-shadow: none !important;
    }

    .resume-photo:hover {
        transform: none;
    }

    /* Typography adjustments */
    .resume-name {
        font-size: 26pt;
    }

    .resume-section-title {
        font-size: 10pt;
        color: #d63031 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .resume-divider {
        background: #d63031 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Prevent breaks inside sections */
    .resume-section {
        page-break-inside: avoid;
    }

    /* Links */
    .reference-phone {
        color: #1a1a1a !important;
    }

    /* Remove all transitions and animations */
    * {
        transition: none !important;
        animation: none !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
