/* ========== index.css — Homepage split layout, demo animation, editor, results ========== */

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #111111;
}

/* ========== Split Layout ========== */
.split-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* --- Left Pane (45%) --- */
.pane-left {
    width: 45vw;
    height: 100vh;
    background: var(--bg-left);
    border-right: var(--border-thick);
    padding: 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

/* --- Right Pane (55%) --- */
.pane-right {
    width: 55vw;
    height: 100vh;
    background: var(--bg-right);
    padding: 40px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ========== Left: Header ========== */
.header-left {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: auto;
}

.header-left .brand { color: var(--text-left); }

.legal-links {
    display: flex;
    gap: 16px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.legal-links a {
    color: var(--text-left);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    padding-bottom: 2px;
}

.legal-links a:hover {
    border-bottom-color: #111;
    transform: translateY(-1px);
}

/* ========== Left: Hero Copy ========== */
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 4vw, 64px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1.5px;
    color: var(--text-left);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.hero-title span {
    display: inline-block;
    background: var(--text-left);
    color: var(--bg-left);
    padding: 4px 12px;
    transform: rotate(-2deg);
    border: var(--border-thin);
    margin-top: 4px;
}

.hero-subtitle {
    font-size: clamp(15px, 1.2vw, 18px);
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-left);
    max-width: 90%;
    margin-bottom: 40px;
}

/* ========== Left: Demo Stage ========== */
.demo-stage {
    width: 100%;
    max-width: 500px;
    height: 280px;
    background: #fff;
    border: var(--border-thick);
    box-shadow: var(--shadow-sharp);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 20px;
}

.demo-header {
    height: 40px;
    border-bottom: var(--border-thick);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    background: #f8f8f8;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.4s;
}

.demo-dots { display: flex; gap: 6px; }
.demo-dot { width: 10px; height: 10px; border: 2px solid #111; border-radius: 50%; }
.demo-dot.red { background: var(--accent-red); }
.demo-dot.yellow { background: var(--bg-left); }
.demo-dot.green { background: var(--accent-green); }

.demo-status {
    padding: 2px 8px;
    border: 2px solid #111;
    text-transform: uppercase;
    background: var(--accent-red);
    color: #fff;
    transition: all 0.4s;
}

.demo-body {
    flex-grow: 1;
    padding: 20px;
    position: relative;
    background: #fff;
}

.demo-text-container {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: #111;
    position: absolute;
    inset: 20px;
}

.demo-text { display: inline; }

.demo-cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: var(--accent-blue);
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink { 50% { opacity: 0; } }

/* Scanner */
.demo-scanner {
    position: absolute;
    left: 0; right: 0; top: -20px;
    height: 4px;
    background: var(--accent-purple);
    box-shadow: 0 0 15px 4px rgba(139, 92, 246, 0.6);
    opacity: 0;
    z-index: 5;
}

.demo-scanner.scanning {
    opacity: 1;
    animation: scan 1.2s ease-in-out;
}

@keyframes scan {
    0% { top: -10px; }
    50% { top: 100%; }
    100% { top: -10px; }
}

/* Stamps */
.demo-stamp {
    position: absolute;
    right: 20px; bottom: 20px;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 8px 16px;
    border: 4px solid #111;
    transform: rotate(-10deg) scale(2);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}
.demo-stamp.stamp-bad { color: var(--accent-red); border-color: var(--accent-red); background: #fff; }
.demo-stamp.stamp-good { color: var(--accent-green); border-color: var(--accent-green); background: #fff; }
.demo-stamp.show { animation: stampDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

@keyframes stampDown {
    to { opacity: 1; transform: rotate(-10deg) scale(1); }
}

/* ========== Right: Nav ========== */
.pane-right .nav-right {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* ========== Right: Workspace ========== */
.workspace {
    flex-grow: 1;
    display: flex;
    gap: 32px;
    min-height: 0;
}

/* Editor Card */
.editor-card {
    flex: 1;
    background: #ffffff;
    border: var(--border-thick);
    box-shadow: var(--shadow-sharp);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 320px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: var(--border-thick);
    background: #f8f8f8;
    flex-shrink: 0;
}

.editor-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-free {
    background: var(--bg-left);
    border: var(--border-thin);
    padding: 4px 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
}

.editor-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.editor-body::-webkit-scrollbar { width: 8px; }
.editor-body::-webkit-scrollbar-thumb { background: #111; }
.editor-body::-webkit-scrollbar-track { background: transparent; border-left: 2px solid #111; }

.input-group { display: flex; flex-direction: column; gap: 8px; }
.group-main { flex-grow: 1; }

.input-label {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}
.input-label span { color: var(--accent-blue); }

.textarea-brutal {
    width: 100%;
    background: var(--bg-right);
    border: var(--border-thin);
    padding: 16px;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-right);
    resize: none;
    outline: none;
    transition: all 0.2s;
}

.textarea-brutal:focus {
    background: #fff;
    box-shadow: var(--shadow-sharp-sm);
}

.textarea-main { height: 100%; flex-grow: 1; }
.textarea-note { height: 80px; }

.char-count {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
}

.editor-footer {
    padding: 20px 24px;
    border-top: var(--border-thick);
    background: #fff;
    flex-shrink: 0;
}

.btn-brutal {
    width: 100%;
    background: var(--accent-blue);
    color: #fff;
    border: var(--border-thick);
    box-shadow: var(--shadow-sharp-sm);
    padding: 16px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-brutal:hover {
    background: var(--accent-blue-hover);
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-sharp);
}

.btn-brutal:active, .btn-brutal.processing {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.btn-brutal.processing {
    background: #111;
    pointer-events: none;
}

/* ========== Right: Results ========== */
.results-container {
    flex: 1;
    display: none;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 12px;
    min-width: 320px;
}

.results-container.visible { display: flex; }

.results-container::-webkit-scrollbar { width: 8px; }
.results-container::-webkit-scrollbar-thumb { background: #111; }
.results-container::-webkit-scrollbar-track { background: transparent; }

.card-brutal {
    background: #fff;
    border: var(--border-thick);
    box-shadow: var(--shadow-sharp-sm);
    padding: 20px;
    flex-shrink: 0;
}

.card-brutal.bg-yellow { background: var(--bg-left); }
.card-brutal.bg-red { background: rgba(239, 68, 68, 0.1); }
.card-brutal.bg-green { background: rgba(16, 185, 129, 0.1); }

.card-header {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.card-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.card-list li {
    font-size: 14px;
    line-height: 1.5;
    padding-left: 16px;
    position: relative;
}

.card-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 6px;
    width: 6px; height: 6px;
    background: #111;
}

.email-result-box {
    background: #fff;
    border: var(--border-thin);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    position: relative;
}

.btn-copy {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--bg-left);
    border: var(--border-thin);
    padding: 4px 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 2px 2px 0px #111;
}
.btn-copy:active { transform: translate(2px, 2px); box-shadow: none; }

.feedback-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    color: #fff;
    padding: 16px 20px;
    border: var(--border-thick);
    flex-shrink: 0;
    margin-bottom: 20px;
}

.feedback-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

.feedback-btns { display: flex; gap: 12px; }

.btn-vote {
    width: 40px; height: 40px;
    background: #fff;
    border: var(--border-thin);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--bg-left);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}
.btn-vote:active { transform: translate(2px, 2px); box-shadow: none; }

/* ========== SVG Icons in Cards ========== */
.icon-card {
    vertical-align: -4px;
    margin-right: 4px;
}

/* ========== Write Another Button ========== */
.btn-write-another {
    background: #111 !important;
    color: var(--bg-left) !important;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.btn-write-another:hover {
    background: #333 !important;
}

/* ========== Full-Screen Loading Overlay ========== */
.overlay-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.overlay-loading.active {
    display: flex;
}

.overlay-inner {
    position: absolute;
    inset: 0;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: overlaySlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes overlaySlideIn {
    0% { transform: scaleY(0); transform-origin: center; }
    100% { transform: scaleY(1); transform-origin: center; }
}

.overlay-loading.closing .overlay-inner {
    animation: overlaySlideOut 0.5s cubic-bezier(0.6, -0.28, 0.74, 0.05) forwards;
}

@keyframes overlaySlideOut {
    0% { clip-path: inset(0 0 0 0); }
    100% { clip-path: inset(50% 0 50% 0); }
}

.overlay-stripes {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 20px,
        rgba(255, 213, 0, 0.03) 20px,
        rgba(255, 213, 0, 0.03) 40px
    );
    pointer-events: none;
}


.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    z-index: 3;
    position: relative;
}

.overlay-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-left);
    border: 4px solid var(--bg-left);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayPencilBounce 1.2s ease-in-out infinite;
}

.overlay-pencil {
    width: 48px;
    height: 48px;
}

@keyframes overlayPencilBounce {
    0%, 100% { transform: rotate(-8deg) translateY(0); }
    25% { transform: rotate(4deg) translateY(-8px); }
    50% { transform: rotate(-4deg) translateY(0); }
    75% { transform: rotate(8deg) translateY(-4px); }
}

.overlay-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 6px;
    text-align: center;
    animation: overlayTitlePulse 2s ease-in-out infinite;
}

@keyframes overlayTitlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.overlay-progress {
    width: 320px;
    max-width: 80vw;
    height: 12px;
    background: #333;
    border: 3px solid var(--bg-left);
    position: relative;
    overflow: hidden;
}

.overlay-progress-bar {
    height: 100%;
    background: var(--bg-left);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.overlay-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, var(--bg-left), #fff, var(--bg-left));
    animation: progressShimmer 1s ease-in-out infinite;
}

@keyframes progressShimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.overlay-step {
    font-family: var(--font-mono);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    min-height: 20px;
    animation: overlayStepFade 0.4s ease;
}

@keyframes overlayStepFade {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ========== Feedback Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #fff;
    border: var(--border-thick);
    box-shadow: 8px 8px 0px #111;
    width: 100%;
    max-width: 520px;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: var(--border-thick);
    background: var(--accent-red);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: transform 0.15s;
}

.modal-close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 24px;
}

.modal-desc {
    font-family: var(--font-body);
    font-size: 15px;
    color: #555;
    margin-bottom: 16px;
    line-height: 1.5;
}

.textarea-feedback {
    height: 120px;
    width: 100%;
    background: var(--bg-right);
    border: var(--border-thin);
    padding: 14px;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: all 0.2s;
}

.textarea-feedback:focus {
    background: #fff;
    box-shadow: var(--shadow-sharp-sm);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
    justify-content: flex-end;
}

.modal-btn-cancel {
    padding: 12px 24px;
    font-size: 14px;
}

.modal-btn-submit {
    padding: 12px 24px;
    font-size: 14px;
    width: auto;
    background: var(--accent-red);
}

.modal-btn-submit:hover {
    background: #dc2626;
}

.modal-btn-submit.processing {
    background: #111;
    pointer-events: none;
}

/* Login modal specifics */
.input-brutal {
    width: 100%;
    background: var(--bg-right);
    border: var(--border-thin);
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
}

.input-brutal:focus {
    background: #fff;
    box-shadow: var(--shadow-sharp-sm);
}

.login-hint {
    font-family: var(--font-mono);
    font-size: 12px;
    margin-top: 10px;
    min-height: 18px;
    line-height: 1.4;
}

.login-hint.success { color: var(--accent-green); }
.login-hint.error { color: var(--accent-red); }

.modal-btn-login {
    background: var(--accent-blue) !important;
}

.modal-btn-login:hover {
    background: var(--accent-blue-hover) !important;
}

/* Signed-in state */
.btn-signin.logged-in {
    background: var(--accent-green) !important;
    color: #fff !important;
    pointer-events: none;
}

/* User menu (logged-in nav) */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--accent-green);
    border: var(--border-thin);
    padding: 6px 12px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    font-size: 12px;
    padding: 6px 14px;
    color: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
}

.btn-logout:hover {
    background: var(--accent-red) !important;
    color: #fff !important;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .split-container { flex-direction: column; height: auto; overflow-y: auto; }
    html, body { overflow-y: auto; height: auto; }
    .pane-left { width: 100%; height: auto; min-height: 100vh; border-right: none; border-bottom: var(--border-thick); }
    .pane-right { width: 100%; height: auto; min-height: 100vh; overflow: visible; }
    .workspace { flex-direction: column; }
    .editor-card { min-height: 600px; }
    .results-container { overflow: visible; }
    .header-left { flex-direction: column; gap: 16px; margin-bottom: 40px; }
}

@media (max-width: 640px) {
    .pane-left, .pane-right { padding: 20px; }
    .hero-title { font-size: 32px; }
    .demo-stage { height: 240px; }
    .legal-links { flex-wrap: wrap; }
}
