:root {
    --bg-black: #000000;
    --dark-teal: #008080;
    /* Updated Mist Color */
    --electric-orange: #FF5733;
    --neon-green: #39FF14;
    --text-white: #ffffff;
    --font-inter: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

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

body,
html {
    width: 100%;
    height: 100%;
    background: url('../common_assets/background-blur.png') no-repeat center center;
    background-size: cover;
    font-family: var(--font-inter);
    color: var(--text-white);
    overflow: hidden;
    perspective: 1000px;
}

.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Background Mist */
.mist-layer {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 35%;
    background: radial-gradient(ellipse at bottom center, rgba(0, 128, 128, 0.4), transparent 60%);
    filter: blur(30px);
    z-index: 1;
    animation: drift-mist 15s infinite alternate ease-in-out;
}

@keyframes drift-mist {
    0% {
        transform: translateX(-5%);
    }

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

/* AI Orb */
.orb-container {
    position: absolute;
    top: 25%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    width: 120px;
    height: 120px;
    transition: all 0.6s ease;
    animation: breathe 4s ease-in-out infinite alternate;
}

.orb-container.processing {
    animation: process-breathe 0.5s ease-in-out infinite alternate;
}

.orb-container.processing .particles {
    animation: swirl 0.5s linear infinite;
    opacity: 1;
}

.orb-container.success .orb-core {
    background: radial-gradient(circle at 30% 30%, #aeff7a 0%, var(--neon-green) 100%);
    box-shadow: 0 0 30px var(--neon-green);
}

.orb-container.success .orb-glow {
    background: var(--neon-green);
}

.orb-container.expanded {
    top: 50%;
    transform: translateY(-50%) scale(5);
    opacity: 0;
}

@keyframes breathe {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

@keyframes process-breathe {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

.orb-glow {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--electric-orange);
    filter: blur(40px);
    opacity: 0.5;
    z-index: 2;
    transition: background 0.5s ease;
}

.orb-outer-glass {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 0 25px rgba(255, 87, 51, 0.2);
    z-index: 4;
}

.orb-core {
    position: absolute;
    width: 44px;
    height: 44px;
    background: radial-gradient(circle at 30% 30%, #FF8C66 0%, var(--electric-orange) 100%);
    border-radius: 50%;
    z-index: 3;
    overflow: hidden;
    box-shadow: 0 0 25px var(--electric-orange);
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

.particles {
    position: relative;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.5;
    animation: swirl 20s linear infinite;
}

@keyframes swirl {
    0% {
        transform: rotate(0deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1.2);
    }
}

/* Glass Message Pane */
.message-pane-wrapper {
    position: absolute;
    top: 55%;
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.4s ease;
}

.message-pane {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 24px 20px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.message-pane.visible {
    opacity: 1;
    transform: translateY(0);
}

.ai-text {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-white);
    letter-spacing: 0.01em;
    line-height: 1.4;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--electric-orange);
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Viewfinder Pane (Stadium Shape) */
.viewfinder-pane {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 320px;
    height: 520px;
    border-radius: 160px;
    /* Stadium shape for portrait */
    padding: 1.5px;
    /* Border thickness */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.05));
    z-index: 5;
    opacity: 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    pointer-events: none;
}

.viewfinder-pane.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.viewfinder-pane.shrinking {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
}

.viewfinder-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 158.5px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
}

.neon-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    box-shadow: inset 0 0 20px rgba(255, 87, 51, 0.5);
    z-index: 2;
    animation: internal-glow 3s ease-in-out infinite alternate;
}

@keyframes internal-glow {
    0% {
        box-shadow: inset 0 0 10px rgba(255, 87, 51, 0.3);
    }

    100% {
        box-shadow: inset 0 0 25px rgba(255, 87, 51, 0.8);
    }
}

/* Simulated Camera Feed (Dark, Contasted) */
.camera-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="320" height="520"><rect width="320" height="520" fill="%23050505"/></svg>');
    background-size: cover;
    background-position: center;
    opacity: 0;
    z-index: 1;
    transition: opacity 1s ease;
    mix-blend-mode: luminosity;
}

.camera-feed.active {
    opacity: 0.6;
}

/* Status Overlays */
.status-overlay {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.70rem;
    color: var(--neon-green);
    letter-spacing: 0.05em;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.status-overlay.visible {
    opacity: 0.8;
}

.top-left {
    top: 60px;
    left: 30px;
}

.bottom-right {
    bottom: 60px;
    right: 30px;
}

/* Scan Line */
.scan-line {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(255, 87, 51, 0.3) 50%, rgba(255, 87, 51, 0.8) 95%, rgba(255, 255, 255, 0.9) 100%);
    z-index: 4;
    opacity: 0;
}

.scan-line.active {
    opacity: 1;
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% {
        top: -20%;
    }

    100% {
        top: 120%;
    }
}

/* Precision Nodes (Joint overlays) */
.precision-nodes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.precision-nodes.visible {
    opacity: 1;
}

.node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--electric-orange);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--electric-orange);
    border: 1px solid white;
}

/* Approx positions for shoulders, elbows, hips */
.n1 {
    top: 30%;
    left: 35%;
}

.n2 {
    top: 30%;
    right: 35%;
}

.n3 {
    top: 45%;
    left: 25%;
}

.n4 {
    top: 45%;
    right: 25%;
}

.n5 {
    top: 55%;
    left: 40%;
}

.n6 {
    top: 55%;
    right: 40%;
}

/* Permission Card */
.permission-card {
    position: absolute;
    bottom: -150px;
    width: 90%;
    max-width: 400px;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 24px;
    z-index: 15;
    transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.permission-card.visible {
    bottom: 30px;
}

.permission-card .modal-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-inter);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

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

.btn-primary {
    background: var(--electric-orange);
    color: white;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(255, 87, 51, 0.3);
}

.btn-primary:hover {
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.4), 0 6px 20px rgba(255, 87, 51, 0.5);
}
.cuesz-logo {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    z-index: 100;
}
