:root {
    --bg-color: #050508;
    --bg-nebula: #0D0D2B;
    --accent: #00D4FF;
    --accent-dim: rgba(0, 212, 255, 0.15);
    --secondary: #7B5EA7;
    --text-main: #F0F4FF;
    --text-muted: #6B7A99;
    --surface: rgba(255, 255, 255, 0.04);
    --warning: #ffb740;

    --font-display: 'Orbitron', sans-serif;
    --font-body: 'DM Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at center, var(--bg-nebula) 0%, var(--bg-color) 70%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Floating Particles Background */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px 2px var(--accent);
    animation: float-particle ease-in-out infinite alternate;
    will-change: transform;
    transform: translateZ(0);
    /* Hardware acceleration */
}

@keyframes float-particle {
    0% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.3;
    }

    33% {
        transform: translateY(-40px) translateX(20px);
        opacity: 0.6;
    }

    66% {
        transform: translateY(-20px) translateX(-15px);
        opacity: 0.4;
    }

    100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.3;
    }
}

/* Screen Pulse Effect */
#pulse-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--accent) 0%, transparent 60%);
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    display: none;
}

.pulse-active {
    display: block !important;
    animation: screen-pulse 1s ease-out forwards;
}

@keyframes screen-pulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    30% {
        opacity: 0.15;
    }

    100% {
        opacity: 0;
        transform: scale(3.5);
    }
}

/* Layout */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 10;
    padding: 2rem 1vw;
    /* Fluid padding */
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.app-header {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(1.5rem, 5vw, 3rem);
    /* Fluid margin */
    position: relative;
}

.logo-container {
    display: flex;
    flex-direction: column;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    color: var(--accent);
    letter-spacing: 0.3em;
    text-shadow: 0 0 10px var(--accent-dim);
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* SEO Content Styles */
.seo-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding: 0 15px;
}

.seo-title {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.seo-desc {
    font-size: 0.9rem;
    margin-top: 0;
    line-height: 1.4;
}

/* Toggle Switch */
.mode-toggle {
    background: var(--surface);
    border: 1px solid var(--accent-dim);
    border-radius: 50px;
    display: flex;
    padding: 4px;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    padding: 8px 20px;
    min-height: 44px;
    /* Touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.toggle-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

/* Main Floating Card */
.main-card {
    background: var(--surface);
    border: 1px solid var(--accent-dim);
    border-radius: 20px;
    width: 100%;
    max-width: clamp(300px, 90vw, 500px);
    /* Responsive width */
    padding: clamp(1.5rem, 5vw, 2.5rem);
    /* Responsive padding */
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: levitate 7s ease-in-out infinite;
    will-change: transform;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

@keyframes levitate {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* Panels Configuration */
.panel {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.panel.active {
    display: flex;
}

/* Mobile Hamburger Nav Styles */
.hamburger-btn {
    display: none;
    /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
    min-height: 44px;
    /* Touch target */
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--accent);
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px var(--accent-dim);
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

.mobile-nav {
    display: none;
    /* Hidden by default entirely */
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--accent-dim);
    border-radius: 12px;
    padding: 1rem;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    width: 90%;
    max-width: 300px;
}

.mobile-nav.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(10px);
}

.mobile-toggle-container {
    width: 100%;
    flex-direction: column;
    /* Stack toggles on mobile */
    padding: 0;
    background: transparent;
    border: none;
}

.mobile-toggle-container .toggle-btn {
    width: 100%;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--accent-dim);
}

.mobile-toggle-container .toggle-btn.active {
    background: var(--accent-dim);
}

/* Drop Zone (PC Mode) */
.drop-zone {
    width: 100%;
    height: 250px;
    position: relative;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    background: rgba(0, 212, 255, 0.02);
}

.drop-zone:hover,
.drop-zone.dragover {
    background: rgba(0, 212, 255, 0.05);
    transform: translateY(-3px);
}

.drop-zone.dragover .icon-circle {
    transform: translateY(-10px);
    box-shadow: 0 0 20px var(--accent);
}

/* Animated dashed border SVG */
.dashed-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.dashed-border rect {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 10, 10;
    stroke-dashoffset: 0;
    opacity: 0.5;
    animation: dash-orbit 15s linear infinite;
}

@keyframes dash-orbit {
    to {
        stroke-dashoffset: -200;
    }
}

.icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    border: 1px solid var(--accent);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.icon-circle svg {
    width: 24px;
    height: 24px;
    fill: var(--accent);
}

.drop-zone h3 {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.drop-zone p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

#file-input {
    display: none;
}

.browse-link {
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    padding: 10px;
    display: inline-block;
    min-height: 44px;
}

.browse-link:hover {
    text-shadow: 0 0 8px var(--accent);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.tag {
    background: var(--surface);
    border: 1px solid rgba(107, 122, 153, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* CODE DISPLAY STATE */
.label {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.big-code-container {
    display: flex;
    gap: 15px;
    margin: 1.5rem 0;
}

.code-digit {
    width: 80px;
    height: 100px;
    background: rgba(0, 212, 255, 0.05);
    border: 2px solid var(--accent);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent);
    box-shadow: 0 0 20px var(--accent-dim), inset 0 0 20px var(--accent-dim);
    opacity: 0;
    transform: translateY(-60px);
}

.drop-in {
    animation: dropIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes dropIn {
    0% {
        opacity: 0;
        transform: translateY(-60px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Expiry countdown */
.countdown-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 1rem 0;
}

.countdown-svg {
    transform: rotate(-90deg);
    width: 60px;
    height: 60px;
}

.countdown-bg {
    fill: none;
    stroke: var(--surface);
    stroke-width: 4;
}

.countdown-progress {
    fill: none;
    stroke: var(--secondary);
    stroke-width: 4;
    stroke-dasharray: 176;
    /* 2 * pi * r (r=28) */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    color: var(--text-main);
}

.file-info {
    font-size: 0.9rem;
    margin: 1rem 0;
    word-break: break-all;
}

.instruction {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 10px 24px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: var(--accent-dim);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--accent-dim);
}

.btn-solid {
    background: var(--accent);
    color: var(--bg-color);
    font-weight: 600;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.btn-solid:hover {
    background: #00e5ff;
    box-shadow: 0 0 20px var(--accent);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.warning {
    color: var(--warning);
    font-size: 0.75rem;
    margin-top: 1.5rem;
}

/* PHONE MODE (RECEIVE) */
.input-row {
    display: flex;
    gap: 15px;
    margin: 2rem 0;
}

.digit-input {
    width: 60px;
    height: 80px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--text-muted);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    text-transform: uppercase;
    outline: none;
    transition: all 0.3s ease;
}

.digit-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-dim), inset 0 0 10px var(--accent-dim);
    transform: translateY(-3px);
}

.invalid-shake {
    animation: horizontal-shaking 0.35s;
}

@keyframes horizontal-shaking {
    0% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(5px);
        border-color: red;
        box-shadow: 0 0 10px red;
    }

    50% {
        transform: translateX(-5px);
        border-color: red;
        box-shadow: 0 0 10px red;
    }

    75% {
        transform: translateX(5px);
        border-color: red;
        box-shadow: 0 0 10px red;
    }

    100% {
        transform: translateX(0)
    }
}

/* Success State */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 2px solid var(--accent);
}

.success-icon svg {
    width: 40px;
    height: 40px;
    fill: var(--accent);
}

.success-title {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.success-desc {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.tiny-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Scrolling Footer Credit */
.scrolling-credit {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    padding: 1rem 0;
    background: rgba(0, 212, 255, 0.05);
    border-top: 1px solid var(--accent-dim);
    border-bottom: 1px solid var(--accent-dim);
    margin-top: auto;
    position: relative;
}

.scrolling-content {
    display: inline-block;
    font-size: 1rem;
    font-family: var(--font-display);
    color: var(--text-main);
    animation: slide-left 25s linear infinite;
}

.scrolling-content span {
    margin-right: 50px;
}

@keyframes slide-left {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

.scrolling-credit a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.scrolling-credit a:hover {
    text-shadow: 0 0 10px var(--accent);
    color: #fff;
}

/* Footer */
footer {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* 1. Mobile (320px - 480px) */
@media (max-width: 480px) {
    .app-header {
        margin-bottom: 2rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .desktop-nav {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    .big-code-container .code-digit {
        width: 50px;
        height: 70px;
        font-size: 2.5rem;
        gap: 8px;
    }

    .input-row .digit-input {
        width: 45px;
        height: 60px;
        font-size: 2rem;
        gap: 8px;
    }

    .main-card {
        padding: 1.25rem;
        width: 95%;
    }

    .big-code-container {
        gap: 8px;
        justify-content: center;
    }

    .input-row {
        gap: 8px;
        justify-content: center;
    }
}

/* 2. Large Phones (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .logo {
        font-size: 1.8rem;
    }

    .desktop-nav {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    .big-code-container .code-digit {
        width: 60px;
        height: 80px;
        font-size: 3rem;
        gap: 10px;
    }

    .input-row .digit-input {
        width: 50px;
        height: 70px;
        font-size: 2.5rem;
        gap: 10px;
    }
}

/* 3. Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .app-container {
        padding: 2rem 5vw;
    }
}

/* 4. Laptops (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .app-container {
        padding: 2rem 10vw;
    }
}

/* 5. Large Screens (1441px+) */
@media (min-width: 1441px) {
    .app-container {
        padding: 3rem 15vw;
    }

    .main-card {
        max-width: 600px;
        padding: 3.5rem;
    }

    .logo {
        font-size: 2.5rem;
    }
}

/* Performance and Loader */
@media (prefers-reduced-motion: reduce),
(max-width: 768px) {
    .particle {
        display: none;
    }

    .main-card {
        animation: none;
        transform: translateY(0);
    }

    .dashed-border rect {
        animation: none;
        opacity: 0.2;
    }

    .scrolling-content {
        animation-duration: 40s;
    }
}

.loader {
    display: inline-block;
    letter-spacing: 2px;
    animation: blink 1.4s infinite both;
}

@keyframes blink {
    0% {
        opacity: .2;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: .2;
    }
}

/* Helper Classes */
.flex-center-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.display-none {
    display: none !important;
}

.recv-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-main);
}

.recv-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error-text {
    color: #ff4d4d;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    min-height: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}