/* ============================================================
   EasySend  -  Premium Dark File-Sharing UI
   ============================================================ */

/* --- Self-Hosted Fonts --- */
@font-face {
    font-family: 'Outfit';
    src: url('/fonts/outfit-variable.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/jetbrains-mono-variable.woff2') format('woff2');
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
}

/* --- Custom Properties --- */
:root {
    --bg-deep:       #06060c;
    --bg-surface:    #0c0c16;
    --bg-card:       #111122;
    --border-dim:    #1a1a2e;
    --border-bright: #2a2a4a;

    --text-primary:  #e8e8f0;
    --text-secondary:#aaaacc;
    --text-muted:    #9999bb;

    --accent:        #00d4ff;
    --accent-dim:    #0099bb;
    --accent-glow:   rgba(0, 212, 255, 0.15);
    --accent-glow-strong: rgba(0, 212, 255, 0.35);

    --success:       #00e88f;
    --success-glow:  rgba(0, 232, 143, 0.2);

    --error:         #ff4466;
    --error-glow:    rgba(255, 68, 102, 0.2);

    --font-display:  'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:     'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Light Theme Override --- */
[data-theme="light"] {
    --bg-deep:       #f5f5f8;
    --bg-surface:    #eeeef2;
    --bg-card:       #ffffff;
    --border-dim:    #dddde5;
    --border-bright: #ccccdd;

    --text-primary:  #1a1a2e;
    --text-secondary:#555570;
    --text-muted:    #8888aa;

    --accent:        #0088cc;
    --accent-dim:    #006699;
    --accent-glow:   rgba(0, 136, 204, 0.12);
    --accent-glow-strong: rgba(0, 136, 204, 0.25);

    --success:       #00b36b;
    --success-glow:  rgba(0, 179, 107, 0.15);

    --error:         #e03050;
    --error-glow:    rgba(224, 48, 80, 0.12);
}

/* --- Language Switcher --- */
.lang-switcher {
    display: flex;
    gap: 0.25rem;
}
.lang-switcher a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.lang-switcher a:hover {
    color: var(--text-primary);
}
.lang-switcher a.lang-active {
    color: var(--accent);
    background: var(--accent-glow);
}

/* --- Skip Navigation --- */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: var(--bg-deep);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.15s;
}
.skip-nav:focus {
    top: 0;
}

/* --- Focus Rings --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* --- Ambient Background --- */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 212, 255, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(100, 0, 255, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 80%, rgba(0, 200, 150, 0.03) 0%, transparent 70%);
}

.bg-noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.025;
    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-size: 200px 200px;
}

/* --- Header --- */
.site-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    flex-shrink: 0;
}

/* --- Theme Toggle --- */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: var(--accent-glow);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    width: 18px;
    height: 18px;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Hide ambient effects in light mode */
[data-theme="light"] .bg-glow,
[data-theme="light"] .bg-noise {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.tagline {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- Main Area --- */
.main {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem 2rem;
}

/* --- State Management --- */
.state {
    display: none;
    width: 100%;
    max-width: 720px;
    animation: fadeScaleIn 0.5s var(--ease-out-expo) both;
}

.state.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes fadeScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================================
   STATE 1: DROPZONE
   ============================================================ */
.dropzone {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 70vh;
    border-radius: 24px;
    cursor: pointer;
    outline: none;
    transition: transform 0.4s var(--ease-out-expo);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover,
.dropzone:focus-visible {
    transform: scale(1.01);
}

.dropzone:focus-visible {
    box-shadow: 0 0 0 3px var(--accent);
}

/* Animated dashed border */
.dropzone-border {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    pointer-events: none;
}

.dropzone-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    border: 2.5px dashed var(--border-bright);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.dropzone:hover .dropzone-border::before,
.dropzone.drag-over .dropzone-border::before {
    border-color: var(--accent);
    box-shadow:
        0 0 40px var(--accent-glow),
        inset 0 0 40px var(--accent-glow);
}

/* Subtle background fill */
.dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(
        170deg,
        rgba(0, 212, 255, 0.03) 0%,
        rgba(10, 10, 20, 0.6) 50%,
        rgba(100, 0, 255, 0.02) 100%
    );
    transition: background 0.4s ease;
}

.dropzone:hover::before,
.dropzone.drag-over::before {
    background: linear-gradient(
        170deg,
        rgba(0, 212, 255, 0.07) 0%,
        rgba(10, 10, 20, 0.6) 50%,
        rgba(100, 0, 255, 0.04) 100%
    );
}

.dropzone-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    width: 100px;
    height: 100px;
    color: var(--accent-dim);
    transition: color 0.4s ease, transform 0.4s var(--ease-out-expo);
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.dropzone:hover .upload-icon,
.dropzone.drag-over .upload-icon {
    color: var(--accent);
    transform: translateY(-6px);
}

.dropzone-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.dropzone-subtitle {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Pulse animation on drag-over */
.dropzone.drag-over {
    animation: dropzonePulse 1.5s ease-in-out infinite;
}

@keyframes dropzonePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.015); }
}

/* ============================================================
   STATE 2: LOADING
   ============================================================ */
.loading-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Triple-ring spinner */
.spinner {
    position: relative;
    width: 100px;
    height: 100px;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px solid transparent;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--accent);
    animation: spinRing 1.2s linear infinite;
}

.spinner-ring:nth-child(2) {
    inset: 10px;
    border-right-color: var(--accent-dim);
    animation: spinRing 1.8s linear infinite reverse;
}

.spinner-ring:nth-child(3) {
    inset: 20px;
    border-bottom-color: rgba(0, 212, 255, 0.3);
    animation: spinRing 2.4s linear infinite;
}

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

.loading-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%  { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.loading-file-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   STATE: ERROR
   ============================================================ */
.error-container {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.error-icon {
    width: 64px;
    height: 64px;
    color: var(--error);
    filter: drop-shadow(0 0 24px var(--error-glow));
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { filter: drop-shadow(0 0 24px var(--error-glow)); }
    50%      { filter: drop-shadow(0 0 40px var(--error-glow)); }
}

.error-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--error);
}

.error-message {
    font-size: 0.95rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
    padding: 1rem 1.5rem;
    background: rgba(255, 68, 102, 0.05);
    border: 1px solid rgba(255, 68, 102, 0.15);
    border-radius: 12px;
}

.btn-retry {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-retry:hover {
    background: rgba(255, 68, 102, 0.1);
    box-shadow: 0 0 20px var(--error-glow);
}

/* ============================================================
   STATE 3: SUCCESS
   ============================================================ */
.success-container {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.success-check {
    width: 64px;
    height: 64px;
    color: var(--success);
    filter: drop-shadow(0 0 24px var(--success-glow));
}

.check-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: drawCheck 0.6s 0.3s var(--ease-out-expo) forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-label {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* The massive download link card */
.download-link {
    display: block;
    width: 100%;
    padding: 2rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    text-decoration: none;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.download-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.download-link:hover {
    border-color: var(--accent-dim);
    box-shadow: 0 8px 40px rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.download-link:hover::before {
    opacity: 1;
}

.download-link-url {
    position: relative;
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: var(--accent);
    word-break: break-all;
    line-height: 1.5;
}

.download-link-hint {
    position: relative;
    display: block;
    margin-top: 0.6rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- URL Sections (two-URL layout) --- */
.url-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.url-label {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.url-hint {
    font-weight: 300;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.82rem;
}

/* Secondary upload link (smaller, subdued) */
.upload-link-display {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.5;
    transition:
        border-color 0.3s ease,
        color 0.3s ease;
}

.upload-link-display:hover {
    border-color: var(--border-bright);
    color: var(--text-primary);
}

/* Secondary copy button style */
.btn-copy-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-bright);
}

.btn-copy-secondary:hover {
    background: var(--border-dim);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-copy-secondary.copied {
    background: var(--success);
    color: var(--bg-deep);
    border-color: var(--success);
    box-shadow: 0 4px 24px var(--success-glow);
}

/* --- Action Buttons --- */
.action-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.25s var(--ease-out-expo),
        box-shadow 0.3s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Copy button */
.btn-copy {
    background: var(--accent);
    color: var(--bg-deep);
}

.btn-copy:hover {
    background: #33ddff;
    box-shadow: 0 4px 24px var(--accent-glow-strong);
}

.btn-copy.copied {
    background: var(--success);
    color: var(--bg-deep);
    box-shadow: 0 4px 24px var(--success-glow);
}

/* Reset / Upload Another button */
.btn-reset {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-bright);
}

.btn-reset:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}

/* ============================================================
   QR CODE SECTION
   ============================================================ */
.qr-code-section {
    text-align: center;
    margin: 1.5rem 0;
}
.qr-code-image {
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
    max-width: 200px;
    height: auto;
}
.qr-code-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 1.25rem 2rem;
    flex-shrink: 0;
}

.site-footer p {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    max-width: 720px;
    margin: 0 auto 1rem;
    text-align: left;
}
.footer-col-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.4rem 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.footer-col a:hover { color: var(--accent); }
.footer-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-dim);
}
.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--text-secondary);
}

/* --- Upload Progress Bar --- */
.progress-bar-container {
    width: 100%;
    max-width: 400px;
    margin-top: 1.5rem;
}
.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--border-dim);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    border-radius: 4px;
    transition: width 0.15s ease-out;
}
.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Encryption Section --- */
/* --- Encrypt Card (Premium) --- */
.encrypt-card {
    width: 100%;
    max-width: 600px;
    margin-top: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    transition: border-color 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
}
.encrypt-card.active {
    border-color: var(--accent-dim);
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(0, 212, 255, 0.06);
}
.encrypt-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.encrypt-icon-wrap {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    flex-shrink: 0;
    transition: background 0.4s, border-color 0.4s, transform 0.4s var(--ease-out-back);
}
.encrypt-card.active .encrypt-icon-wrap {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--accent-dim);
}
.encrypt-lock-icon {
    color: var(--text-muted);
    transition: color 0.4s, filter 0.4s;
}
.encrypt-card.active .encrypt-lock-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent-glow-strong));
}
.encrypt-card.active .encrypt-icon-wrap {
    animation: lockPulse 0.5s var(--ease-out-back);
}
@keyframes lockPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.15) rotate(-8deg); }
    70% { transform: scale(1.05) rotate(3deg); }
    100% { transform: scale(1); }
}
.encrypt-info {
    flex: 1;
    min-width: 0;
}
.encrypt-title {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.3;
}
.encrypt-subtitle {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-top: 0.1rem;
}
/* Toggle track */
.encrypt-toggle {
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}
.encrypt-toggle input { display: none; }
.encrypt-toggle-track {
    width: 48px;
    height: 26px;
    background: var(--border-dim);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
    display: block;
}
.encrypt-toggle-thumb {
    display: block;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s var(--ease-out-back), background 0.3s, box-shadow 0.3s;
}
.encrypt-toggle input:checked + .encrypt-toggle-track {
    background: var(--accent);
}
.encrypt-toggle input:checked + .encrypt-toggle-track .encrypt-toggle-thumb {
    transform: translateX(22px);
    background: var(--bg-deep);
    box-shadow: 0 0 8px var(--accent-glow-strong);
}

/* Password fields  -  animated reveal */
.encrypt-fields {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s var(--ease-out-expo), opacity 0.3s 0.05s, margin-top 0.4s;
    margin-top: 0;
}
.encrypt-fields.visible {
    max-height: 280px;
    opacity: 1;
    margin-top: 1rem;
}
.encrypt-input-wrap {
    position: relative;
    margin-bottom: 0.5rem;
}
.encrypt-input {
    width: 100%;
    padding: 0.7rem 2.75rem 0.7rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.encrypt-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.encrypt-eye-btn {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.encrypt-eye-btn:hover {
    color: var(--text-secondary);
}
.encrypt-match-indicator {
    position: absolute;
    right: 2.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    transition: opacity 0.2s;
}
.encrypt-match-indicator.match {
    color: var(--success);
}
.encrypt-match-indicator.no-match {
    color: var(--error);
}

/* Strength bar */
.encrypt-strength {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    min-height: 16px;
}
.encrypt-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border-dim);
    border-radius: 2px;
    overflow: hidden;
}
.encrypt-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s var(--ease-out-expo), background 0.3s;
}
.encrypt-strength-fill.weak { width: 33%; background: var(--error); }
.encrypt-strength-fill.medium { width: 66%; background: #f0a030; }
.encrypt-strength-fill.strong { width: 100%; background: var(--success); }
.encrypt-strength-text {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 52px;
    text-align: right;
}
.encrypt-strength-text.weak { color: var(--error); }
.encrypt-strength-text.medium { color: #f0a030; }
.encrypt-strength-text.strong { color: var(--success); }

/* Warning callout */
.encrypt-warning-box {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 68, 102, 0.06);
    border: 1px solid rgba(255, 68, 102, 0.12);
    border-radius: 8px;
    margin-top: 0.25rem;
}
.encrypt-warning-box svg {
    color: var(--error);
    flex-shrink: 0;
    margin-top: 1px;
}
.encrypt-warning-box span {
    font-size: 0.73rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* --- Custom Link Section --- */
.custom-link-section {
    width: 100%;
    max-width: 600px;
    margin-top: 0.75rem;
}
.custom-link-inner {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    padding: 0 0.75rem;
    transition: border-color 0.2s;
    position: relative;
}
.custom-link-inner:focus-within {
    border-color: var(--accent);
}
.custom-link-prefix {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.custom-link-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.7rem 0;
    min-width: 0;
}
.custom-link-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}
.custom-link-status {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 0.5rem;
}
.custom-link-status.available {
    color: var(--success);
}
.custom-link-status.taken {
    color: var(--error);
}
.custom-link-status.checking {
    color: var(--text-muted);
}
.short-url-warning {
    display: none;
    font-size: 0.72rem;
    color: #f0a030;
    margin-top: 0.35rem;
    line-height: 1.5;
}
.short-url-warning.visible {
    display: block;
}
.info-tip {
    padding: 0.6rem 1rem;
    background: rgba(240, 160, 48, 0.06);
    border: 1px solid rgba(240, 160, 48, 0.15);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}
.info-tip a {
    color: var(--accent);
    text-decoration: none;
}

.custom-link-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* --- Bundle Note Section --- */
.note-section {
    width: 100%;
    max-width: 600px;
    margin-top: 0.75rem;
}
.note-inner {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    transition: border-color 0.2s;
}
.note-inner:focus-within {
    border-color: var(--accent);
}
.note-input {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    padding: 0.7rem 0.75rem;
    resize: vertical;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.5;
}
.note-input::placeholder {
    color: var(--text-muted);
}

/* Bundle note display (viewer page) */
.bundle-note {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.bundle-note-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- Notify Email Section --- */
.notify-section {
    width: 100%;
    max-width: 600px;
    margin-top: 0.75rem;
}
.notify-inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    padding: 0.1rem 0.75rem;
    transition: border-color 0.2s;
}
.notify-inner:focus-within {
    border-color: var(--accent);
}
.notify-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}
.notify-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    padding: 0.7rem 0;
}
.notify-input::placeholder {
    color: var(--text-muted);
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--border-dim) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    margin-bottom: 0.75rem;
}
.skeleton-icon {
    width: 40px;
    height: 48px;
    flex-shrink: 0;
}
.skeleton-lines {
    flex: 1;
}
.skeleton-line {
    height: 12px;
    margin-bottom: 0.5rem;
}
.skeleton-line:last-child {
    margin-bottom: 0;
    width: 60%;
}
.skeleton-btn {
    width: 80px;
    height: 32px;
    flex-shrink: 0;
}

/* ============================================================
   MICRO-INTERACTIONS
   ============================================================ */

/* Button hover/active */
.btn, .pricing-btn, .error-btn, .viewer-copy-link-btn, .btn-download, .btn-download-all {
    transition: all 0.3s var(--ease-out-expo);
}
.btn:active, .pricing-btn:active, .viewer-copy-link-btn:active, .btn-download:active, .btn-download-all:active {
    transform: scale(0.97);
}

/* File card hover  -  left accent border */
.file-card {
    border-left: 3px solid transparent;
    transition: border-color 0.25s, transform 0.25s var(--ease-out-expo);
}
.file-card:hover {
    border-left-color: var(--accent);
}

/* Dropzone idle bob */
.dropzone-icon {
    animation: idleBob 3s ease-in-out infinite;
}
@keyframes idleBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Dropzone border pulse */
.dropzone {
    animation: borderPulse 4s ease-in-out infinite;
}
@keyframes borderPulse {
    0%, 100% { border-color: var(--border-dim); }
    50% { border-color: var(--border-bright); }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s var(--ease-out-expo);
    max-width: 320px;
}
.toast.removing {
    animation: toastOut 0.25s ease-in forwards;
}
.toast--success {
    border-color: rgba(0, 232, 143, 0.3);
}
.toast--error {
    border-color: rgba(255, 68, 102, 0.3);
}
.toast--success::before {
    content: '\2713';
    color: var(--success);
    font-weight: 700;
}
.toast--error::before {
    content: '\2717';
    color: var(--error);
    font-weight: 700;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(1rem) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(0.5rem) scale(0.95); }
}
@media (max-width: 600px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    .toast {
        max-width: none;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        gap: 0.25rem;
        padding: 1.2rem 1.25rem;
    }

    .main {
        padding: 0.5rem 1.25rem 1.5rem;
    }

    .dropzone {
        aspect-ratio: 3 / 4;
        border-radius: 18px;
    }

    .dropzone-border::before {
        border-radius: 18px;
    }

    .dropzone::before {
        border-radius: 18px;
    }

    .upload-icon {
        width: 72px;
        height: 72px;
    }

    .download-link {
        padding: 1.5rem 1.25rem;
        border-radius: 14px;
    }

    .action-row {
        flex-direction: column;
        width: 100%;
    }

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

    /* Encrypt card mobile */
    .encrypt-card {
        padding: 0.85rem 1rem;
    }
    .encrypt-header {
        gap: 0.65rem;
    }
    .encrypt-icon-wrap {
        width: 38px;
        height: 38px;
    }
    .encrypt-lock-icon {
        width: 22px;
        height: 22px;
    }
    .encrypt-title {
        font-size: 0.88rem;
    }
    .encrypt-subtitle {
        font-size: 0.72rem;
    }
    .encrypt-input {
        padding: 0.75rem 2.75rem 0.75rem 0.85rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    .encrypt-eye-btn {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
}

/* ============================================================
   MOBILE USABILITY (SEOptimer/Lighthouse fixes)
   ============================================================ */

/* Minimum tap target sizes */
button, a, input, select, textarea, [role="button"] {
    touch-action: manipulation;
}

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
}
pre, code {
    overflow-x: auto;
    max-width: 100%;
}
img {
    max-width: 100%;
    height: auto;
}
table {
    overflow-x: auto;
    display: block;
    max-width: 100%;
}

/* Ensure footer links have adequate tap targets */
.footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.25rem;
}

/* Share buttons minimum tap target */
.share-btn {
    min-width: 44px;
    min-height: 44px;
}

/* Theme toggle minimum tap target */
.theme-toggle {
    min-width: 44px;
    min-height: 44px;
}

/* Ensure readable text on mobile */
@media (max-width: 600px) {
    body {
        font-size: 1rem;
    }
    .file-name {
        font-size: 0.9rem;
    }
    .file-size, .file-time, .file-downloads {
        font-size: 0.8rem;
    }
    .site-footer p {
        font-size: 0.85rem;
    }
    .footer-links {
        gap: 0.25rem;
    }
    .footer-links a {
        font-size: 0.85rem;
    }
    /* URL overflow prevention */
    .viewer-copy-link-url, .share-url, code, .mono {
        word-break: break-all;
    }
}

/* --- Homepage SEO Content --- */
.seo-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 0;
    content-visibility: auto;
    contain-intrinsic-size: auto 1200px;
}
.seo-content .hero-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}
.seo-content .hero-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2.5rem;
}
.seo-section-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.seo-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.seo-step-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.seo-step-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}
.seo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    padding: 1rem;
}
.seo-card-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}
.seo-card-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}
.seo-card-text a, .seo-step-text a, .seo-content p a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    -webkit-text-decoration-color: var(--accent);
    text-decoration-color: var(--accent);
    text-decoration-style: solid;
}
.seo-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.seo-price-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}
.seo-price-name {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.seo-price-value {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent);
    font-size: 1.3rem;
    margin: 0.3rem 0;
}
.seo-price-detail {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

/* --- Full-Page Drag Overlay --- */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 6, 12, 0.92);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.drag-overlay-content {
    text-align: center;
    color: var(--accent);
    pointer-events: none;
}
.drag-overlay-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    animation: floatUp 1.5s ease-in-out infinite;
}
@keyframes floatUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.drag-overlay h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.drag-overlay p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ============================================================
   DRAG-OVER BODY EFFECT (full page highlight)
   ============================================================ */
body.dragging-over .bg-glow {
    background:
        radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    transition: background 0.3s ease;
}

/* ============================================================
   SHARE BUTTONS (reusable across pages)
   ============================================================ */
.share-section {
    width: 100%;
    margin-top: 1.5rem;
}
.btn-native-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: var(--accent);
    color: var(--bg-deep);
    border: none;
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-bottom: 1rem;
}
.btn-native-share:hover { opacity: 0.85; }
.share-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0.75rem 0;
    position: relative;
}
.share-divider::before, .share-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--border-dim);
}
.share-divider::before { left: 0; }
.share-divider::after { right: 0; }
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
    min-width: 40px;
    min-height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.share-btn-label { display: none; }
.share-btn:hover { transform: translateY(-2px); }
.share-btn:active { transform: scale(0.95); }
.share-whatsapp { color: #25d366; } .share-whatsapp:hover { border-color: #25d366; background: rgba(37,211,102,0.08); }
.share-telegram { color: #0088cc; } .share-telegram:hover { border-color: #0088cc; background: rgba(0,136,204,0.08); }
.share-twitter { color: #e8e8f0; } .share-twitter:hover { border-color: #e8e8f0; background: rgba(232,232,240,0.05); }
.share-facebook { color: #1877f2; } .share-facebook:hover { border-color: #1877f2; background: rgba(24,119,242,0.08); }
.share-reddit { color: #ff4500; } .share-reddit:hover { border-color: #ff4500; background: rgba(255,69,0,0.08); }
.share-linkedin { color: #0a66c2; } .share-linkedin:hover { border-color: #0a66c2; background: rgba(10,102,194,0.08); }
.share-email-toggle { color: var(--accent); cursor: pointer; font-family: inherit; } .share-email-toggle:hover { border-color: var(--accent); background: var(--accent-glow); }
.share-sms { color: var(--success); } .share-sms:hover { border-color: var(--success); background: var(--success-glow); }

/* Share via Email inline form */
.share-email-form {
    width: 100%;
    margin-top: 0.75rem;
    animation: fadeIn 0.2s ease;
}
.share-email-form-inner {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.share-email-input,
.share-email-message {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.share-email-input:focus,
.share-email-message:focus {
    border-color: var(--accent);
}
.share-email-message {
    resize: vertical;
    min-height: 2.5rem;
    max-height: 6rem;
}
.share-email-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.btn-share-email-send {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #06060c;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}
.btn-share-email-send:hover { opacity: 0.85; }
.btn-share-email-send:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-share-email-cancel {
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s, border-color 0.2s;
}
.btn-share-email-cancel:hover { color: var(--text-primary); border-color: var(--text-muted); }
.share-email-status {
    font-size: 0.8rem;
    padding: 0.4rem 0;
    line-height: 1.4;
}
.share-email-status.success { color: var(--success); }
.share-email-status.error { color: #ff4466; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
