/**
 * AFSNote - Base Styles
 * Reset, typography, layout fundamentals
 */

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

html {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
    transition: background var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Safe area padding for notched devices */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Prevent overscroll/bounce */
html, body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* App Layout - Fixed shell */
#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
    background: var(--bg);
    overflow: hidden;
    position: relative;
}

/* Header - Fixed at top */
.header {
    background: var(--header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--divider);
    padding: 12px 16px;
    flex-shrink: 0;
    z-index: 100;
}

/* Main content area - fills remaining space */
main.editor-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* View Containers - Each view fills the main area */
.view-container {
    display: none !important;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.view-container.active {
    display: flex !important;
}

/* Overlay Base */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 1500;
    flex-direction: column;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.overlay.show {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}
