/* ==============================================================================
   Project Antigravity Style System (Vanilla CSS with Rich Aesthetics)
   ============================================================================== */

:root {
    --bg-main: hsl(230, 25%, 7%);
    --bg-gradient: linear-gradient(135deg, hsl(230, 25%, 7%) 0%, hsl(245, 30%, 12%) 100%);
    --panel-bg: hsla(230, 20%, 12%, 0.45);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    
    --primary: hsl(265, 85%, 65%);
    --primary-hover: hsl(265, 85%, 70%);
    --primary-glow: hsla(265, 85%, 65%, 0.35);
    
    --accent: hsl(180, 80%, 45%);
    --accent-hover: hsl(180, 80%, 55%);
    --accent-glow: hsla(180, 80%, 45%, 0.3);

    --text-primary: hsl(0, 0%, 95%);
    --text-dim: hsl(230, 15%, 65%);
    --text-muted: hsl(230, 10%, 45%);
    
    --connected: hsl(145, 75%, 45%);
    --connecting: hsl(45, 85%, 50%);
    --disconnected: hsl(0, 75%, 45%);
    
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Futuristic background graphics */
.app-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    z-index: -2;
}

.app-background::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
    animation: orbit-glow 25s infinite alternate ease-in-out;
}

.app-background::after {
    content: '';
    position: absolute;
    bottom: 10%;
    right: 15%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0,0,0,0) 75%);
    border-radius: 50%;
    filter: blur(50px);
    z-index: -1;
    animation: orbit-glow 35s infinite alternate-reverse ease-in-out;
}

/* Glassmorphism Outer Wrapper */
.glass-container {
    width: 92vw;
    max-width: 1280px;
    background: var(--panel-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: var(--panel-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1;
}

/* Header styling */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, var(--text-primary) 30%, var(--text-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pulse-icon {
    width: 12px;
    height: 12px;
    background-color: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: pulse-ring 2s infinite ease-in-out;
}

.connection-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.connection-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--connecting);
}

.connection-status.connected::before {
    background-color: var(--connected);
    box-shadow: 0 0 8px var(--connected);
}
.connection-status.connecting::before {
    background-color: var(--connecting);
    box-shadow: 0 0 8px var(--connecting);
}
.connection-status.disconnected::before {
    background-color: var(--disconnected);
    box-shadow: 0 0 8px var(--disconnected);
}

/* Control Panel with Address Bar */
.control-panel {
    display: flex;
    gap: 12px;
    align-items: center;
}

.address-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 4px 6px 4px 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.address-bar-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.globe-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    margin-right: 10px;
}

.address-bar-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 0.95rem;
    height: 36px;
}

.address-bar-wrapper input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    outline: none;
    font-family: var(--font-stack);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 18px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 10px var(--primary-glow);
}

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

.settings-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.keyboard-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.keyboard-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.keyboard-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Navigation control styles */
.nav-controls {
    display: flex;
    gap: 6px;
}

.nav-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.nav-icon-btn:active {
    transform: scale(0.95);
}

/* Icon scaling and styling */
.nav-icon-btn svg,
.settings-btn svg,
.keyboard-btn svg,
.globe-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.globe-icon svg {
    width: 18px;
    height: 18px;
}

/* Settings configuration drawer */
.settings-panel {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: slide-down 0.3s ease-out;
}

.settings-panel.hidden {
    display: none;
}

.settings-panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.settings-note {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dim);
}

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-stack);
    outline: none;
    font-size: 0.9rem;
}

.input-group input:focus {
    border-color: var(--accent);
}

.accent-btn {
    background: var(--accent);
    color: var(--bg-main);
    border: none;
    font-family: var(--font-stack);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    align-self: flex-start;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.accent-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Workspace Canvas screen */
.workspace-area {
    width: 100%;
    display: flex;
    justify-content: center;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 1920px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

#interactiveCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair; /* Visually distinct click target cursor */
    touch-action: none; /* Prevents mobile browser touch gestures from scrolling the page */
}

#hiddenInput {
    opacity: 0.01;
    position: absolute;
    left: -9999px;
    width: 200px;
    height: 40px;
    font-size: 16px;
    z-index: -1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: transparent;
}



/* Footer tags */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.info-tag {
    background: rgba(0, 0, 0, 0.15);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
}

.white-text {
    color: var(--text-dim);
}

.url-display {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

/* Animations */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 hsla(180, 80%, 45%, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px hsla(180, 80%, 45%, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 hsla(180, 80%, 45%, 0);
    }
}

@keyframes orbit-glow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(8%, 8%) scale(1.1);
    }
}

@keyframes slide-down {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float-bounce {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-10px);
    }
}

/* Responsive adjustment */
@media(max-width: 768px) {
    .glass-container {
        padding: 16px;
        gap: 14px;
    }
    .logo h1 {
        font-size: 1.25rem;
    }
    footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .url-display {
        max-width: 100%;
        text-align: left;
    }
}
