/* Ownly Design System. Its fonts come from the layout's font link, so each face is declared once. */

:root {
    --app-viewport-height: 100vh;
    --app-viewport-top: 0px;
    --app-viewport-bottom: 0px;
    --bottom-nav-height: calc(80px + var(--app-safe-area-bottom, env(safe-area-inset-bottom, 0px)));
    /* Colors */
    --bg-dark: #0F0F0F;
    --bg-card: #1C1C1C;
    --bg-surface: #262626;
    --accent: #00FF7F;
    --accent-hover: #00E672;
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-muted: #636366;
    --border-color: #2C2C2E;
    --error: #FF3B30;
    --success: #34C759;
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #1C1C1E 0%, #0F0F0F 100%);
    
    /* Shadows */
    --shadow-accent: 0 4px 20px rgba(0, 255, 127, 0.25);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

@supports (height: 100dvh) {
    :root { --app-viewport-height: 100dvh; }
}

/* Clip decoration at the screen edge without creating a nested scroller. A double tap
   never zooms the page; app-viewport.js stops a page that fits the screen from moving. */
html {
    overflow-x: hidden;
    overflow-x: clip;
    touch-action: manipulation;
}

/* As in an app, a long press selects nothing and opens no copy menu; only what you type
   can be selected. */
html { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable]:not([contenteditable="false"]) {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

html:has(.bottom-nav) {
    scroll-padding-bottom: calc(var(--bottom-nav-height) + 16px);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-x: clip;
    line-height: 1.6;
}

main {
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    margin: 0;
}

/* Layout Helpers */
.container-fluid {
    padding: 0 20px;
}

/* UI Components */

/* Buttons */
.btn-ownly {
    background: var(--accent);
    color: #000;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
}

.btn-ownly:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

.btn-ownly-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-ownly-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Cards */
.card-ownly {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card-ownly:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: var(--app-viewport-bottom);
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    height: var(--bottom-nav-height);
    flex-shrink: 0;
    background: rgba(8, 8, 8, 0.72);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 max(24px, var(--app-safe-area-right, env(safe-area-inset-right, 0px))) var(--app-safe-area-bottom, env(safe-area-inset-bottom, 0px)) max(24px, var(--app-safe-area-left, env(safe-area-inset-left, 0px)));
    z-index: 700;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 22px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-item.active {
    background: #FFE632;
    color: #000;
    padding: 0 18px;
    box-shadow: none;
}

.nav-item.active .nav-icon-home {
    color: #00873C;
}

.nav-item .nav-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-item.active .nav-icon {
    width: 21px;
    height: 21px;
}

.nav-item .nav-label {
    display: none;
}

.nav-item.active .nav-label {
    display: inline;
}

.nav-icon-wrap { position: relative; display: inline-flex; }
@media (hover: hover) and (pointer: fine) {
    .nav-item:hover { background-color: rgba(255,255,255,0.1); }
    .nav-item.active:hover { background-color: #FFED69; }
}
.nav-item { -webkit-tap-highlight-color: transparent; }
.nav-item:active { transform: scale(0.96); }
.nav-item:focus-visible, .search-explore-link:focus-visible {
    outline: 2px solid #FFE632;
    outline-offset: 4px;
}
.search-explore-link {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 44px; margin-bottom: 16px; padding: 0 16px;
    border-radius: 12px; background: #1C1C1E; color: #fff;
    font-size: 14px; text-decoration: none;
    transition: background-color 0.2s;
}
.search-explore-link:hover { background: #2C2C2E; }
@media (max-width: 360px) {
    .bottom-nav { padding-inline: max(16px, var(--app-safe-area-left, env(safe-area-inset-left, 0px))) max(16px, var(--app-safe-area-right, env(safe-area-inset-right, 0px))); }
    .nav-item.active { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .nav-item, .home-header .hdr-icon-btn, .home-header .hdr-avatar, .search-explore-link { transition: none; }
}

.nav-profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.2);
}

.nav-create-btn {
    width: 52px;
    height: 52px;
    background: #00FF7F;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -26px;
    box-shadow: 0 0 24px rgba(0,255,127,0.45);
    border: 3px solid #0F0F0F;
    color: #000;
    font-size: 22px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.nav-create-btn:active {
    transform: scale(0.92) rotate(45deg);
    box-shadow: 0 0 14px rgba(0,255,127,0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* Utilities */
.text-accent { color: var(--accent); }
.text-secondary { color: var(--text-secondary); }
.bg-dark { background-color: var(--bg-dark); }
.bg-accent { background-color: var(--accent); }
.rounded-xl { border-radius: 20px; }
.cursor-pointer { cursor: pointer; }
