:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --danger: #ef4444;
    --warning: #f59e0b;
    --safe: #22c55e;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font); }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gradient-bg {
    position: absolute;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% -20%, #1e293b, #0f172a);
    z-index: 0;
}

#organic-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.3;
    pointer-events: none;
}

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.1rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--safe);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.container {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.content-wrapper {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease;
}

.mode-badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
    display: inline-block;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(to bottom, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 40px;
}

.drop-zone-indicator {
    width: 100%;
    background: var(--card-bg);
    border: 2px dashed var(--border);
    padding: 40px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone-indicator:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.icon-large { font-size: 3rem; margin-bottom: 10px; }
.text-main { font-weight: 600; color: var(--text-main); font-size: 1.1rem; }
.text-sub { color: var(--text-muted); font-size: 0.9rem; }

.input-wrapper {
    display: flex;
    gap: 8px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid var(--border);
    width: 100%;
}

.code-input {
    background: transparent;
    border: none;
    color: white;
    padding: 12px 20px;
    font-size: 1rem;
    flex: 1;
    outline: none;
}

.connect-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connect-btn:hover { transform: scale(1.05); }

.processing-wrapper {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.loader {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
}

.circular {
    animation: rotate 2s linear infinite;
    height: 100%;
    width: 100%;
}

.path {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    stroke: var(--primary);
    animation: dash 1.5s ease-in-out infinite;
    stroke-linecap: round;
}

.sub-status { color: var(--text-muted); font-size: 0.9rem; margin-top: 5px; }

.progress-bar-track {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.2s;
}

.result-wrapper {
    display: none;
    text-align: center;
    animation: fadeIn 0.4s ease;
    width: 100%;
}

.success-icon-large { font-size: 4rem; margin-bottom: 20px; }

.toggle-container {
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: 50px;
    display: inline-flex;
    margin-bottom: 20px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 24px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: white;
    color: black;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.code-box, .link-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.code-box:hover, .link-box:hover { border-color: var(--primary); }

#final-code { font-family: monospace; font-size: 1.8rem; font-weight: 600; letter-spacing: 1px; display: block;}
#final-link { font-family: monospace; font-size: 1rem; color: var(--primary); word-break: break-all; display: block;}

.copy-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 1px;
    font-weight: 600;
}

.reset-main {
    background: transparent;
    border: none;
    color: var(--text-muted);
    margin-top: 30px;
    cursor: pointer;
    font-size: 0.9rem;
}
.reset-main:hover { color: white; text-decoration: underline; }

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    text-align: left;
}

.file-icon-display { font-size: 2rem; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 12px; }
.file-details h3 { font-size: 1rem; margin-bottom: 4px; word-break: break-all; }
.file-details span { font-size: 0.85rem; color: var(--text-muted); }

.security-card {
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    border: 1px solid var(--border);
}

.security-card.safe { border-color: var(--safe); background: rgba(34, 197, 94, 0.05); }
.security-card.warning { border-color: var(--warning); background: rgba(245, 158, 11, 0.05); }
.security-card.danger { border-color: var(--danger); background: rgba(239, 68, 68, 0.05); }

.scan-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.scan-header .icon { font-size: 1.2rem; }
.scan-header .title { font-weight: 600; font-size: 1rem; }

.scan-body p { margin: 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

.scan-metrics {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.metric { display: flex; flex-direction: column; }
.metric .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.metric .value { font-family: monospace; font-size: 0.9rem; color: var(--text-main); margin-top: 4px; }

.primary-action-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px var(--primary-glow);
}

.text-btn { background: transparent; border: none; color: var(--text-muted); margin-top: 15px; cursor: pointer; }

.dock-container { position: absolute; bottom: 30px; z-index: 20; }
.dock {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: 50px;
    display: flex;
    gap: 6px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.dock-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dock-item:hover { color: white; background: rgba(255,255,255,0.05); }
.dock-item.active { background: white; color: black; font-weight: 600; }

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
    background: #1e293b;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 600px;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content { transform: scale(1); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
}

.modal-header h2 { font-size: 1.5rem; margin: 0; background: none; -webkit-text-fill-color: white; }
.close-btn { background: transparent; border: none; font-size: 2rem; color: var(--text-muted); cursor: pointer; line-height: 1; }
.close-btn:hover { color: white; }

.info-block { margin-bottom: 25px; text-align: left; }
.info-block h3 { color: var(--primary); font-size: 1.1rem; margin-bottom: 8px; }
.info-block p { font-size: 0.95rem; color: #cbd5e1; margin: 0; line-height: 1.6; }

@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.processing-wrapper {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
}

.holo-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.holo-core {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 30px var(--primary), inset 0 0 20px white;
    animation: core-pulse 1.5s ease-in-out infinite alternate;
    z-index: 2;
}

.holo-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary);
    border-left: 2px solid var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.holo-ring.outer {
    width: 100%;
    height: 100%;
    border-width: 3px;
    opacity: 0.7;
    animation: spin-3d 3s linear infinite;
}

.holo-ring.inner {
    width: 70%;
    height: 70%;
    border-color: #a855f7;
    border-bottom: 2px solid #a855f7;
    border-right: 2px solid #a855f7;
    border-top: transparent;
    border-left: transparent;
    opacity: 0.9;
    animation: spin-reverse 2s linear infinite;
}

.holo-particles span {
    position: absolute;
    top: 50%; left: 50%;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white;
    opacity: 0;
    animation: particle-rise 2s ease-in-out infinite;
}

.holo-particles span:nth-child(1) { animation-delay: 0s; }
.holo-particles span:nth-child(2) { animation-delay: 0.5s; }
.holo-particles span:nth-child(3) { animation-delay: 1s; }
.holo-particles span:nth-child(4) { animation-delay: 1.5s; }

.cyber-progress-track {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-top: 25px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.cyber-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    box-shadow: 0 0 20px var(--primary);
    position: relative;
    transition: width 0.1s linear;
}

.cyber-glare {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg) translateX(-150%);
    animation: glare-slide 1.5s infinite;
}

.glow-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 0 10px var(--primary-glow);
    margin-bottom: 5px;
}

@keyframes spin-3d {
    0% { transform: translate(-50%, -50%) rotateX(60deg) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) rotateX(60deg) rotateZ(360deg); }
}

@keyframes spin-reverse {
    0% { transform: translate(-50%, -50%) rotateX(-40deg) rotateZ(360deg); }
    100% { transform: translate(-50%, -50%) rotateX(-40deg) rotateZ(0deg); }
}

@keyframes core-pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; box-shadow: 0 0 50px var(--primary); }
}

@keyframes particle-rise {
    0% { transform: translate(-50%, -50%) translateY(0) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) translateY(-60px) scale(0); opacity: 0; }
}

@keyframes glare-slide {
    0% { transform: skewX(-20deg) translateX(-150%); }
    100% { transform: skewX(-20deg) translateX(400%); }
}
