/* Layout CSS - Navigation, Main Container */

/* Navigation */
.nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--gray-900);
    font-weight: 600;
    font-size: 18px;
}

.nav-brand svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
}

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

/* Hamburger button (mobile) */
.hamburger-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
}

.hamburger-line {
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--white);
    z-index: 999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
}

.mobile-menu-title {
    font-size: 18px;
    font-weight: 600;
}

.mobile-menu-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.mobile-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.mobile-nav-link.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
}

/* Main Layout */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Sync status badge */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 12px;
    color: var(--gray-600);
}

.sync-status.synced {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.sync-status.syncing {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.sync-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.sync-status.syncing .dot {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Embed mode - hide chrome when inside Ringo iframe */
.embed-mode .nav,
.embed-mode .mobile-menu,
.embed-mode .mobile-menu-overlay {
    display: none !important;
}
.embed-mode .main {
    padding-top: 16px;
    max-width: 100%;
}
.embed-mode .loading-overlay {
    top: 0;
}

/* Hide sync status text on very small screens, show only dot */
@media (max-width: 480px) {
    .sync-status {
        padding: 6px;
        font-size: 0;
        min-width: 20px;
        justify-content: center;
    }

    .sync-status .dot {
        margin: 0;
    }
}
