:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.8);
    --accent-color: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --danger-color: #ff4d4d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; /* Hide body scroll for mobile app feel */
    height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-online { background-color: #3fb950; box-shadow: 0 0 8px #3fb950; }
.status-offline { background-color: var(--text-secondary); }

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.video-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.shadow-premium {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.glassmorphism {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.controls-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ptz-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    border-radius: 20px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    width: 250px;
}

.ptz-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    outline: none;
}

.ptz-btn:active {
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: scale(0.92);
}

.ptz-btn svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

#ptz-up { grid-column: 2; grid-row: 1; }
#ptz-left { grid-column: 1; grid-row: 2; }
.ptz-center { 
    grid-column: 2; grid-row: 2; 
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: bold; color: var(--text-secondary);
}
#ptz-right { grid-column: 3; grid-row: 2; }
#ptz-down { grid-column: 2; grid-row: 3; }

.intercom-container {
    display: flex;
    justify-content: center;
}

#intercom-btn {
    width: 100%;
    padding: 20px;
    border: none;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

#intercom-btn.active {
    background: var(--danger-color);
    box-shadow: 0 0 25px rgba(255, 77, 77, 0.5);
    transform: scale(0.98);
}

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

#intercom-text {
    font-weight: 500;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
