/* 
    VISION PRO AI - Professional Edition Design System
    Inspired by iOS/Android Native Patterns
*/

:root {
    --ios-bg: #000000;
    --ios-accent: #0A84FF;
    --ios-green: #30D158;
    --ios-red: #FF453A;
    --ios-gray: #1C1C1E;
    --ios-secondary: #2C2C2E;
    --glass-white: rgba(255, 255, 255, 0.12);
    --glass-dark: rgba(28, 28, 30, 0.85);
    --glass-blur: blur(50px);
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--ios-bg);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

/* --- PROFESSIONAL BOOT SCREEN --- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.boot-content {
    text-align: center;
    position: relative;
    width: 100%;
}

.vpro-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.v-letter {
    font-size: 5rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -5px;
}

.pro-tag {
    background: var(--ios-accent);
    color: #fff;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 900;
    margin-top: 15px;
}

.scanner-line {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ios-accent), transparent);
    box-shadow: 0 0 15px var(--ios-accent);
    animation: scan 3s infinite ease-in-out;
}

.boot-status {
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 2px;
    margin-bottom: 60px;
}

.connect-btn {
    background: var(--ios-accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
}

.input-with-action {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.input-with-action input {
    flex: 1;
}

.connect-btn.active {
    background: var(--ios-green);
    box-shadow: 0 0 20px rgba(48, 209, 88, 0.4);
}

.connect-btn.error {
    background: var(--ios-red);
    box-shadow: 0 0 20px rgba(255, 69, 58, 0.4);
}

.boot-status {
    font-size: 0.8rem;
    color: var(--ios-accent);
    letter-spacing: 2px;
    margin-bottom: 40px;
    font-weight: 700;
}

.boot-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.g_id_signin {
    transform: scale(1.1);
    margin-top: 10px;
}

.btn-primary-ios {
    background: #fff;
    color: #000;
    border: none;
    padding: 18px 40px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 10px 30px rgba(255,255,255,0.2);
}

/* --- HEADER SYSTEM --- */
#vpro-header {
    height: calc(50px + var(--safe-top));
    padding: var(--safe-top) 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 100;
}

.system-time { font-weight: 700; font-size: 0.95rem; }

.system-indicators {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

.pill {
    background: rgba(255,255,255,0.08);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.pill.active { background: rgba(48, 209, 88, 0.15); color: var(--ios-green); }
.pill.error { background: rgba(255, 69, 58, 0.15); color: var(--ios-red); }
.pill.inactive { color: rgba(255,255,255,0.2); }

.status-dot { 
    width: 5px; height: 5px; border-radius: 50%; background: currentColor;
    box-shadow: 0 0 5px currentColor;
}

/* --- VISION HUB (HUD) --- */
#vision-hub {
    position: relative;
    width: 100%;
    height: 48vh;
    background: #000;
}

#webcam { width: 100%; height: 100%; object-fit: cover; }

#vision-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.aim-reticle {
    width: 80px;
    height: 80px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    position: relative;
}

.aim-reticle::after, .aim-reticle::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--ios-accent);
    border-style: solid;
}

.aim-reticle::before { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.aim-reticle::after { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

.radar {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.radar-line {
    width: 50%;
    height: 1px;
    background: var(--ios-accent);
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: left;
    animation: rotate-radar 2s linear infinite;
}

.hud-labels {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-box {
    font-size: 0.55rem;
    font-weight: 800;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- INTERACTION PANEL --- */
#interaction-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    background: linear-gradient(180deg, #111 0%, #000 100%);
    border-radius: 32px 32px 0 0;
    margin-top: -24px;
    position: relative;
    z-index: 50;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.ios-card {
    background: var(--ios-gray);
    border-radius: 24px;
    padding: 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.card-hint {
    position: absolute;
    top: 12px;
    font-size: 0.6rem;
    font-weight: 900;
    color: #444;
    letter-spacing: 1px;
}

#ai-response {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.4;
    color: #fff;
    max-width: 90%;
}

.active-voice .visualizer-container { 
    opacity: 0.2; 
    transition: opacity 0.3s;
}

.active-voice.speaking .visualizer-container { 
    opacity: 1; 
}

.v-bar {
    width: 3px;
    height: 100%;
    background: var(--ios-accent);
    border-radius: 4px;
    transform: scaleY(0.4);
    transition: transform 0.3s;
}

.active-voice.speaking .v-bar {
    animation: bounce 0.8s infinite alternate;
}

/* --- ACTION BUTTONS --- */
#quick-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 0;
}

.circle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--ios-gray);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-btn.brain-active {
    color: var(--ios-green);
    box-shadow: 0 0 10px rgba(48, 209, 88, 0.2);
}

.main-mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    border: none;
    padding: 4px;
    cursor: pointer;
}

.mic-inner {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--ios-accent);
    transition: all 0.2s;
}

.main-mic-btn:active .mic-inner { transform: scale(0.9); }

/* --- BOTTOM TAB BAR --- */
#bottom-tabs {
    background: rgba(18, 18, 18, 0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(255,255,255,0.1);
    height: calc(85px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    display: flex;
    justify-content: space-around;
    padding-top: 8px;
    z-index: 1000;
}

.tab-item {
    background: none;
    border: none;
    color: #8E8E93;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 20%;
    cursor: pointer;
    transition: color 0.2s;
}

.tab-item i { font-size: 1.4rem; }
.tab-item span { font-size: 0.65rem; font-weight: 500; }

.tab-item.active { color: var(--ios-accent); }

/* --- IOS SHEET (SETTINGS & MODALS) --- */
.ios-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    background: var(--ios-gray);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    z-index: 100000;
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: var(--safe-bottom);
    display: block;
}

.ios-sheet.hidden { transform: translateY(100%); }

.sheet-handle {
    width: 36px;
    height: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    margin: 10px auto;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
}

.sheet-header h2 { font-size: 1.1rem; font-weight: 800; }
.sheet-header button { 
    background: none; border: none; 
    color: var(--ios-accent); font-size: 1.05rem; font-weight: 600; 
}

/* --- BRAIN STATUS CARD --- */
.brain-status-card {
    background: var(--ios-secondary);
    margin: 0 20px 20px;
    padding: 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255,255,255,0.05);
}

.brain-status-card i {
    font-size: 2rem;
    color: var(--ios-accent);
}

.status-info {
    display: flex;
    flex-direction: column;
}

.status-info span {
    font-weight: 700;
    font-size: 1rem;
}

.status-info small {
    color: #8E8E93;
    font-size: 0.8rem;
}

/* --- SETTINGS LIST & ITEMS --- */
.settings-list { padding: 0 20px; }
.settings-group { margin-bottom: 30px; }
.settings-group h3 { 
    color: #8E8E93; font-size: 0.75rem; font-weight: 500; 
    text-transform: uppercase; margin-bottom: 10px; 
}

.setting-item {
    background: rgba(255,255,255,0.05);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flex-row input {
    flex: 1;
}

.small-btn {
    background: var(--ios-accent);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.setting-item span { font-size: 0.9rem; font-weight: 500; }
.setting-item input {
    background: none; border: none; color: #fff;
    font-size: 1rem; outline: none; padding: 4px 0;
}

.hint {
    font-size: 0.75rem;
    color: #8E8E93;
    margin-bottom: 15px;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.action-item {
    background: var(--ios-secondary);
    border: none;
    color: #fff;
    padding: 15px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.action-item i {
    font-size: 1.2rem;
    color: var(--ios-accent);
}

.ios-switch-group {
    display: flex;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 3px;
}

.ios-switch-group button {
    flex: 1; border: none; background: none;
    color: #888; padding: 8px; font-size: 0.7rem;
    font-weight: 800; border-radius: 8px; transition: all 0.2s;
}

.ios-switch-group button.active {
    background: #3a3a3c; color: #fff;
}

.btn-save-ios {
    width: calc(100% - 40px);
    margin: 20px;
    background: var(--ios-accent);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- ANIMATIONS --- */
@keyframes scan {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.2; }
    50% { transform: translate(-50%, 100px); opacity: 1; }
}

@keyframes rotate-radar {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    from { transform: scaleY(1); }
    to { transform: scaleY(0.4); }
}

.v-bar:nth-child(2) { animation-delay: 0.1s; }
.v-bar:nth-child(3) { animation-delay: 0.2s; }
.v-bar:nth-child(4) { animation-delay: 0.3s; }
.v-bar:nth-child(5) { animation-delay: 0.4s; }

.hidden { display: none !important; }

/* --- NEURAL BRIDGE v5.0 --- */
#vpro-header {
    z-index: 1000;
}

#neural-indicators {
    display: flex;
    gap: 15px;
    margin-right: 20px;
}

.indicator {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.indicator i {
    color: var(--ios-accent);
}

#ind-local.active {
    color: var(--ios-green);
    background: rgba(48, 209, 88, 0.2);
    border-color: var(--ios-green);
}

.neural-icon-wrapper {
    margin-bottom: 25px;
    font-size: 3.5rem;
    color: var(--ios-accent);
}

.brain-pulse {
    animation: brainPulse 2s infinite ease-in-out;
}

@keyframes brainPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px var(--ios-accent)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 25px var(--ios-accent)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 5px var(--ios-accent)); }
}

.progress-box {
    width: 100%;
    max-width: 320px;
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

#neural-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--ios-accent), #5ac8fa);
    transition: width 0.3s cubic-bezier(0.1, 0.7, 1, 0.1);
}

#engine-display {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 3px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ios-accent);
    text-transform: uppercase;
    margin: 5px 0;
    border-left: 2px solid var(--ios-accent);
    transition: all 0.3s ease;
}

.engine-hardware { color: #5ac8fa !important; border-color: #5ac8fa !important; }
.engine-account { color: #ff9500 !important; border-color: #ff9500 !important; }
.engine-rtx { color: var(--ios-green) !important; border-color: var(--ios-green) !important; }

