/* Theme custom properties */
:root {
    --bg-app: hsl(224, 25%, 8%);
    --bg-sidebar: hsl(224, 25%, 11%);
    --bg-glass: rgba(30, 41, 59, 0.5);
    --border-glass: rgba(255, 255, 255, 0.06);
    
    --color-text-main: hsl(210, 40%, 96%);
    --color-text-muted: hsl(215, 20%, 65%);
    --color-text-dark: hsl(215, 25%, 27%);
    
    --accent-primary: hsl(217, 91%, 60%);
    --accent-secondary: hsl(263, 90%, 65%);
    --accent-glow: rgba(59, 130, 246, 0.35);
    
    --success: hsl(142, 72%, 45%);
    --success-glow: rgba(34, 197, 94, 0.2);
    --warning: hsl(38, 92%, 50%);
    --danger: hsl(0, 84%, 60%);
    
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--color-text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 70% 30%, rgba(99, 102, 241, 0.05), transparent 60%);
}

/* Sidebar */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-glass);
}

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

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow-y: auto;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-text-muted);
}

/* Status Card */
.status-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.status-label {
    color: var(--color-text-muted);
}

.status-value {
    font-family: var(--font-mono);
    color: var(--color-text-main);
    font-size: 0.8rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
}

.status-badge.online {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-text-muted);
    display: inline-block;
}

.status-badge.online .pulse-dot {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Sidebar Buttons */
.control-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--color-text-main);
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    transition: var(--transition-smooth);
    width: 100%;
}

.control-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1rem;
}

/* Info Box */
.info-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.info-text {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.info-text.warning {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.06);
    border-radius: 6px;
    padding: 8px;
    border: 1px solid rgba(245, 158, 11, 0.1);
}

.info-text.warning i {
    margin-right: 4px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass);
    text-align: center;
}

.footer-version {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-dark);
}

/* Main Workspace */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    gap: 16px;
}

/* Address bar Header Mockup */
.app-header {
    display: flex;
    align-items: center;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-glass);
    border-radius: 12px 12px 0 0;
    padding: 12px 20px;
    margin-bottom: -16px;
    z-index: 5;
}

.browser-address-bar {
    display: grid;
    grid-template-columns: 80px 140px 1fr;
    width: 100%;
    align-items: center;
    gap: 16px;
}

.address-actions {
    display: flex;
    gap: 8px;
}

.circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.circle.red { background-color: var(--danger); }
.circle.yellow { background-color: var(--warning); }
.circle.green { background-color: var(--success); }

/* Navigation buttons */
.navigation-controls {
    display: flex;
    gap: 6px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.nav-btn:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.05);
}

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

/* Address bar Form input */
.address-input-wrapper {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-smooth);
}

.address-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
    background: rgba(0, 0, 0, 0.4);
}

.security-icon {
    font-size: 0.8rem;
    color: var(--success);
}

.security-icon.insecure {
    color: var(--warning);
}

.address-input {
    background: none;
    border: none;
    outline: none;
    color: var(--color-text-main);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    width: 100%;
    letter-spacing: -0.2px;
}

/* Viewport for Stream */
.viewport-container {
    flex: 1;
    position: relative;
    border: 1px solid var(--border-glass);
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: #111827;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewport-wrapper {
    width: 100%;
    height: 100%;
    outline: none;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    cursor: crosshair;
}

.viewport-wrapper:focus {
    box-shadow: inset 0 0 0 2px var(--accent-primary);
}

.browser-viewport {
    width: 100%;
    height: 100%;
    object-fit: contain; /* scaling with aspect ratio */
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Viewport loading overlay */
.browser-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 4;
    transition: opacity 0.5s ease;
}

.overlay-text {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.spinner-wrapper {
    width: 40px;
    height: 40px;
    position: relative;
}

.double-bounce1, .double-bounce2 {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--accent-primary);
    opacity: 0.6;
    position: absolute;
    top: 0;
    left: 0;
    animation: bounce 2.0s infinite ease-in-out;
}

.double-bounce2 {
    background-color: var(--accent-secondary);
    animation-delay: -1.0s;
}

@keyframes bounce {
    0%, 100% { transform: scale(0.0); }
    50% { transform: scale(1.0); }
}
