/* ============================================
   editpdffree.com — Styles
   Aesthetic: Premium dark with warm accents
   ============================================ */

:root {
    --bg: #0c0c0f;
    --bg-raised: #141419;
    --bg-card: #1a1a22;
    --bg-card-hover: #22222e;
    --surface: #1e1e28;
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --text: #f0ede8;
    --text-muted: #8a8690;
    --text-dim: #5c5868;
    --red: #e84444;
    --red-soft: rgba(232, 68, 68, 0.12);
    --green: #3cb043;
    --green-soft: rgba(60, 176, 67, 0.12);
    --gold: #d4a017;
    --gold-soft: rgba(212, 160, 23, 0.12);
    --blue: #4a90d9;
    --blue-soft: rgba(74, 144, 217, 0.12);
    --accent: #e84444;
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --max-width: 1200px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Grain overlay */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 24px;
    background: rgba(12, 12, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo img {
    height: 32px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color var(--transition);
}

.nav-link:hover {
    color: var(--text);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition);
}

.nav-btn:hover {
    background: #d63a3a;
    transform: translateY(-1px);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.hero-orb--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(232, 68, 68, 0.3), transparent 70%);
    top: -200px;
    right: -100px;
    animation: float-1 20s ease-in-out infinite;
}

.hero-orb--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.2), transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: float-2 25s ease-in-out infinite;
}

.hero-orb--3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(60, 176, 67, 0.15), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float-3 18s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-40px, 30px); }
    66% { transform: translate(20px, -20px); }
}

@keyframes float-2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -40px); }
    66% { transform: translate(-20px, 20px); }
}

@keyframes float-3 {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-45%, -55%); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(60, 176, 67, 0.1);
    border: 1px solid rgba(60, 176, 67, 0.2);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--green);
    margin-bottom: 32px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: var(--text);
}

.hero-title--accent {
    color: var(--accent);
    font-style: italic;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 40px;
    font-weight: 300;
}

/* Hero Socials */
.hero-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.hero-social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color var(--transition);
}

.hero-social-link:hover {
    color: var(--text);
}

.hero-social-link svg {
    opacity: 0.7;
    transition: opacity var(--transition);
}

.hero-social-link:hover svg {
    opacity: 1;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 64px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.btn--primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 24px rgba(232, 68, 68, 0.3);
}

.btn--primary:hover {
    background: #d63a3a;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(232, 68, 68, 0.4);
}

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

.btn--ghost:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-light);
}

/* ============================================
   Editor Section
   ============================================ */

.editor-section {
    padding: 80px 24px 120px;
    background: var(--bg);
}

.editor-section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    margin-bottom: 12px;
    color: var(--text);
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 300;
}

.editor-wrapper {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Upload Zone */
.upload-zone {
    position: relative;
    padding: 60px 40px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.008) 10px,
        rgba(255, 255, 255, 0.008) 20px
    );
}

.upload-zone:hover {
    background: rgba(232, 68, 68, 0.03);
}

.upload-zone.drag-over {
    background: rgba(232, 68, 68, 0.06);
    border-color: var(--accent);
}

/* Full-page drag overlay */
body.drag-over-page::after {
    content: 'Drop your PDF anywhere';
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 12, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 3px dashed var(--accent);
    margin: 16px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent);
    pointer-events: none;
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    color: var(--text-dim);
    margin-bottom: 16px;
    transition: color var(--transition), transform var(--transition);
}

.upload-zone:hover .upload-icon {
    color: var(--accent);
    transform: translateY(-4px);
}

.upload-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.upload-text strong {
    color: var(--text);
    font-weight: 600;
}

.upload-hint {
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* Upload zone hidden when PDF is loaded */
.upload-zone.hidden {
    display: none;
}

/* Toolbar */
.toolbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.toolbar.visible {
    display: flex;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.toolbar-btn--save {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.toolbar-btn--save:hover:not(:disabled) {
    background: #d63a3a;
}

.toolbar-btn--save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-filename {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 400;
}

/* PDF Container */
.pdf-container {
    overflow: hidden;
}

.pdf-viewer {
    background: var(--bg-card);
    overflow-y: auto;
    max-height: 80vh;
    min-height: 400px;
    padding: 24px;
}

.placeholder {
    text-align: center;
    color: var(--text-dim);
    padding: 100px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.placeholder-icon {
    color: var(--text-dim);
    opacity: 0.4;
    margin-bottom: 8px;
}

.placeholder p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.placeholder small {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* PDF Page rendering */
.pdf-page {
    margin-bottom: 20px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
}

.editable-text {
    color: transparent;
    white-space: pre;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s, background-color 0.15s;
    box-sizing: content-box;
}

.editable-text:hover {
    color: black;
    background-color: white;
    box-shadow: 0 0 0 2px rgba(232, 68, 68, 0.4);
}

.editable-text.modified {
    color: black;
    background: white;
    outline: 1px solid rgba(60, 176, 67, 0.5);
    display: inline-block;
}

.editable-text.modified:hover {
    outline-color: rgba(60, 176, 67, 0.8);
}

.editable-text.editing {
    color: black !important;
    background: white;
    outline: 2px solid var(--accent);
    z-index: 1000;
    user-select: text;
    display: inline-block;
}

/* ============================================
   Features Section
   ============================================ */

.features {
    padding: 100px 24px 120px;
    background: var(--bg-raised);
    border-top: 1px solid var(--border);
}

.features-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 48px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
}

.feature-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 20px;
}

.feature-icon--red {
    background: var(--red-soft);
    color: var(--red);
}

.feature-icon--green {
    background: var(--green-soft);
    color: var(--green);
}

.feature-icon--gold {
    background: var(--gold-soft);
    color: var(--gold);
}

.feature-icon--blue {
    background: var(--blue-soft);
    color: var(--blue);
}

.feature-title {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 300;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    border-top: 1px solid var(--border);
    padding: 48px 24px 24px;
    background: var(--bg);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.footer-logo {
    height: 28px;
    width: auto;
    display: block;
    margin-bottom: 8px;
    opacity: 0.7;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 300;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.footer-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 400;
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
}

.footer-social:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 300;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(40px) scale(0.9);
    background: var(--accent);
    color: white;
    padding: 18px 36px;
    border-radius: 14px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 12px 48px rgba(232, 68, 68, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: none;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    animation: toast-shake 0.5s 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes toast-shake {
    0%, 100% { transform: translateX(-50%) translateY(0) scale(1) rotate(0deg); }
    20% { transform: translateX(-50%) translateY(0) scale(1) rotate(-2deg); }
    40% { transform: translateX(-50%) translateY(0) scale(1) rotate(2deg); }
    60% { transform: translateX(-50%) translateY(0) scale(1) rotate(-1deg); }
    80% { transform: translateX(-50%) translateY(0) scale(1) rotate(1deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    transform: translateY(16px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.visible .modal {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text);
}

.modal-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 16px;
}

.modal-input-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
}

.modal-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition);
}

.modal-input:focus {
    border-color: var(--accent);
}

.modal-ext {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-left: none;
    border-radius: 0 10px 10px 0;
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 10px 22px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.modal-btn--cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.modal-btn--cancel:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.modal-btn--confirm {
    background: var(--accent);
    color: white;
}

.modal-btn--confirm:hover {
    background: #d63a3a;
}

/* ============================================
   Animations
   ============================================ */

[data-animate] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }
[data-delay="4"] { transition-delay: 0.4s; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .nav-links {
        gap: 16px;
    }

    .nav-link {
        display: none;
    }

    .hero {
        padding: 100px 20px 60px;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-subtitle br {
        display: none;
    }

    .hero-actions {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 48px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .upload-zone {
        padding: 40px 24px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .footer-links {
        align-items: flex-start;
    }

    .toolbar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        justify-content: space-between;
    }
}
