/* WTC ROBOTICS - PROFESSIONAL DESIGN SYSTEM */

:root {
    --primary-bg: #e5e5ea;
    /* Apple-like system grey */
    --secondary-bg: #ffffff;
    --accent-orange: #FF6600;
    /* Keep brand accent */
    --accent-orange-glow: rgba(255, 102, 0, 0.4);
    --text-primary: #000000;
    /* Pure black for max contrast */
    --text-secondary: #3a3a3c;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    /* Stronger shadow */

    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    /* Expert Round 2: Darker Studio Stone for Silhouette (Critique #4) */
    background: radial-gradient(circle at 50% 30%, #a0a0b0 0%, #70707a 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 102, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 102, 0, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(40px, 40px);
    }
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* HEADER */

.header {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    animation: slideDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--glass-shadow);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.logo:hover {
    border-color: var(--accent-orange);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.logo-icon-img {
    height: 28px;
    /* Slightly smaller logo */
    width: auto;
    object-fit: contain;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #FF6600 0%, #FF8833 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-orange);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--accent-orange);
    animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {

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

    50% {
        transform: scale(0.8);
        opacity: 0.6;
    }
}

.status-dot.glow {
    animation: glowPulse 1s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px var(--accent-orange);
    }

    50% {
        box-shadow: 0 0 40px var(--accent-orange-glow);
    }
}

.status-text {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* DIALOG SYSTEM */

.dialog-container {
    position: absolute;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 750px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dialog-box {
    display: flex;
    gap: 24px;
    padding: 28px 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    border: 2px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog-box:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(255, 102, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@keyframes fadeInUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dialog-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-ring,
.avatar-ring-2 {
    position: absolute;
    width: 70px;
    height: 70px;
    border: 2px solid var(--accent-orange);
    border-radius: 50%;
    opacity: 0.3;
    animation: ringPulse 3s ease-in-out infinite;
}

.avatar-ring-2 {
    animation-delay: 1.5s;
}

@keyframes ringPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.avatar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #FF8833 100%);
    border-radius: 50%;
    font-size: 28px;
    box-shadow: 0 0 30px rgba(255, 102, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.dialog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dialog-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-orange);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.dialog-text {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 400;
}

.user-response {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-response.show {
    display: flex;
}

.response-icon {
    font-size: 24px;
    opacity: 0.7;
}

.response-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-secondary);
    font-style: italic;
}

/* CONTROL PANEL - HIDDEN */

.control-panel {
    display: none !important;
    /* Completely hidden */
}

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

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

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

/* DEBUG */

.debug-info {
    display: none !important;
    /* Force hide */
}

.debug-info:hover {
    opacity: 1;
}

.debug-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 6px 0;
    color: var(--text-secondary);
}

.debug-row span:first-child {
    color: var(--accent-orange);
    font-weight: bold;
}

/* LOADING SCREEN */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-logo {
    margin-bottom: 48px;
}

.logo-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 102, 0, 0.1) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
}

.logo-circle svg {
    width: 80px;
    height: 80px;
    stroke: var(--accent-orange);
    fill: var(--accent-orange);
    filter: drop-shadow(0 0 20px rgba(255, 102, 0, 0.5));
}

.loading-text {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #FF8833 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-bar {
    width: 360px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 24px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-orange) 0%, #FF8833 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
}

.loading-status {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* MIC PERMISSION SCREEN */

.mic-permission-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.4s ease;
}

.mic-permission-screen.show {
    display: flex;
}

.mic-permission-content {
    text-align: center;
    max-width: 500px;
    padding: 48px;
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    border: 2px solid var(--glass-border);
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 100px rgba(255, 102, 0, 0.2);
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.mic-icon-large {
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #FF8833 100%);
    box-shadow: 0 0 60px rgba(255, 102, 0, 0.4);
}

.mic-icon-large svg {
    width: 50px;
    height: 50px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mic-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.mic-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 36px;
}

.mic-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-mic-allow,
.btn-mic-deny {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-mic-allow {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #FF8833 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.4);
}

.btn-mic-allow:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(255, 102, 0, 0.5);
}

.btn-mic-allow svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-mic-deny {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* RESPONSIVE */

@media (max-width: 768px) {
    .header {
        top: 15px;
        left: 15px;
        right: 15px;
        gap: 10px;
    }

    .logo {
        padding: 12px 20px;
        gap: 12px;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }

    .logo-text {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .status-indicator {
        padding: 12px 20px;
    }

    .status-text {
        font-size: 11px;
    }

    .dialog-container {
        bottom: 80px;
        width: 95%;
        padding: 0 10px;
    }

    .dialog-box {
        padding: 20px;
        gap: 16px;
        border-radius: 20px;
    }

    .avatar-ring,
    .avatar-ring-2 {
        width: 55px;
        height: 55px;
    }

    .avatar-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .dialog-name {
        font-size: 12px;
        letter-spacing: 1.5px;
    }

    .dialog-text {
        font-size: 15px;
        line-height: 1.5;
    }

    .user-response {
        padding: 14px 18px;
        border-radius: 16px;
    }

    .response-icon {
        font-size: 20px;
    }

    .response-text {
        font-size: 14px;
    }

    .debug-info {
        bottom: 10px;
        right: 10px;
        padding: 10px 14px;
        font-size: 10px;
    }

    .loading-logo {
        margin-bottom: 32px;
    }

    .logo-circle {
        width: 90px;
        height: 90px;
        margin-bottom: 20px;
    }

    .logo-circle svg {
        width: 60px;
        height: 60px;
    }

    .loading-text {
        font-size: 22px;
        letter-spacing: 3px;
    }

    .loading-bar {
        width: 280px;
    }

    .loading-status {
        font-size: 12px;
    }

    .mic-permission-content {
        padding: 36px 28px;
        margin: 0 20px;
        border-radius: 28px;
    }

    .mic-icon-large {
        width: 80px;
        height: 80px;
        margin-bottom: 24px;
    }

    .mic-icon-large svg {
        width: 40px;
        height: 40px;
    }

    .mic-title {
        font-size: 24px;
        margin-bottom: 12px;
        letter-spacing: 1.5px;
    }

    .mic-description {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 28px;
    }

    .mic-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .btn-mic-allow,
    .btn-mic-deny {
        width: 100%;
        padding: 14px 28px;
        font-size: 14px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .logo {
        padding: 10px 16px;
        gap: 10px;
    }

    .logo-text {
        font-size: 12px;
    }

    .status-indicator {
        padding: 10px 16px;
    }

    .dialog-container {
        bottom: 60px;
    }

    .dialog-box {
        padding: 16px;
        gap: 12px;
    }

    .avatar-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .dialog-text {
        font-size: 14px;
    }

    .debug-info {
        font-size: 9px;
        padding: 8px 12px;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .header {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .dialog-container {
        bottom: 50px;
        max-width: 600px;
    }

    .dialog-box {
        padding: 16px 20px;
    }

    .debug-info {
        bottom: 5px;
        right: 5px;
        font-size: 9px;
    }
}