/* Moto360 - Base Layout & Mobile Bottom Navigation System */

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

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    line-height: 1.5;
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Application Container */
.app-container {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
}

/* Sidebar Desktop */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform var(--transition-normal);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #090d16;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-indigo) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.brand-info h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.brand-info span {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.nav-menu {
    flex: 1;
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1.1rem;
    min-height: var(--touch-target);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: var(--font-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.nav-item:hover {
    color: #ffffff;
    background-color: var(--bg-sidebar-hover);
    transform: translateX(3px);
}

.nav-item.active {
    color: #ffffff;
    background-color: var(--accent-blue);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #090d16;
}

.demo-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: var(--font-xs);
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.pulse-dot {
    width: 9px;
    height: 9px;
    background-color: #38bdf8;
    border-radius: 50%;
    box-shadow: 0 0 10px #38bdf8;
}

/* Main Wrapper Layout */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-bottom: 2rem;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.page-title h2 {
    font-size: var(--font-xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 0.55rem 1.25rem;
    width: 320px;
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-blue);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-box svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: var(--font-sm);
    color: var(--text-primary);
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Mobile Top Header Toggle */
.mobile-header-bar {
    display: none;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    background-color: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.mobile-nav-items {
    display: flex;
    width: 100%;
    height: var(--mobile-nav-height);
    align-items: center;
    justify-content: space-around;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.mobile-nav-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.mobile-nav-btn.active {
    color: #38bdf8;
}

.mobile-nav-btn.active svg {
    stroke: #38bdf8;
}

/* Content Views SPA */
.content-view {
    display: none;
    padding: 2rem;
}

.content-view.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Media Queries Mobile First */
@media (max-width: 1024px) {
    .search-box {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        padding-bottom: calc(var(--mobile-nav-height) + 1.5rem);
    }

    .top-header {
        padding: 0 1rem;
        height: 64px;
    }

    .page-title h2 {
        font-size: var(--font-lg);
    }

    .search-box {
        display: none;
    }

    .content-view {
        padding: 1rem;
    }

    .mobile-bottom-nav {
        display: block;
    }
}
