/* RY Tracker — Spatial Gesture Navigation Styles (css/spatialNavigation.css) */

/* ── SPATIAL DEPTH INDICATOR (Minimal Header Micro-Pill) ───────────────── */
.spatial-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-full, 9999px);
    margin: 4px auto 8px auto;
    width: fit-content;
    user-select: none;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.spatial-step-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted, #928C78);
    opacity: 0.45;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

/* 44px touch target padding for mobile accessibility */
.spatial-step-dot::after {
    content: '';
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: -10px;
    right: -10px;
}

.spatial-step-dot.active {
    opacity: 1;
    background: var(--cta, #33513F);
    width: 18px;
    border-radius: 4px;
}

.spatial-step-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary, #8A8570);
    margin-left: 2px;
    cursor: pointer;
    padding: 2px 4px;
}

/* ── SPATIAL TRANSITIONS (Zoom-Space) ─────────────────────────────────── */
.screen.spatial-screen {
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center center;
    will-change: transform, opacity;
}

/* Pinch-In: Transitioning to broader context */
.spatial-entering-in {
    animation: spatialZoomInEnter 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.spatial-leaving-in {
    animation: spatialZoomInExit 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Pinch-Out: Transitioning to narrower focus */
.spatial-entering-out {
    animation: spatialZoomOutEnter 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.spatial-leaving-out {
    animation: spatialZoomOutExit 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes spatialZoomInEnter {
    from { opacity: 0; transform: scale(1.06); }
    to { opacity: 1; transform: scale(1.0); }
}

@keyframes spatialZoomInExit {
    from { opacity: 1; transform: scale(1.0); }
    to { opacity: 0; transform: scale(0.94); }
}

@keyframes spatialZoomOutEnter {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1.0); }
}

@keyframes spatialZoomOutExit {
    from { opacity: 1; transform: scale(1.0); }
    to { opacity: 0; transform: scale(1.06); }
}

/* Boundary rubber-band tactile response */
.spatial-rubber-band-in {
    animation: spatialRubberIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.spatial-rubber-band-out {
    animation: spatialRubberOut 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spatialRubberIn {
    0% { transform: scale(1.0); }
    50% { transform: scale(0.97); }
    100% { transform: scale(1.0); }
}

@keyframes spatialRubberOut {
    0% { transform: scale(1.0); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1.0); }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .screen.spatial-screen,
    .spatial-entering-in,
    .spatial-leaving-in,
    .spatial-entering-out,
    .spatial-leaving-out,
    .spatial-rubber-band-in,
    .spatial-rubber-band-out {
        animation: none !important;
        transition: opacity 0.15s ease !important;
        transform: none !important;
    }
}

/* ── LEVEL 2: TÜM ALIŞKANLIKLAR (All Habits Screen) ───────────────────── */
#screen-all-habits {
    padding-bottom: 24px;
}

.all-habits-header {
    margin-bottom: 16px;
}

.all-habits-summary-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface, #FFFFFF);
    border: 0.5px solid var(--border, #E4E0D4);
    border-radius: var(--radius-lg, 16px);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.all-habits-stat {
    display: flex;
    flex-direction: column;
}

.all-habits-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #20251F);
    line-height: 1.2;
}

.all-habits-stat-label {
    font-size: 11px;
    color: var(--text-secondary, #8A8570);
    font-weight: 500;
}

.all-habits-stat-divider {
    width: 1px;
    height: 24px;
    background: var(--border, #E4E0D4);
}

.all-habits-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.all-habit-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface, #FFFFFF);
    border: 0.5px solid var(--border, #E4E0D4);
    border-radius: var(--radius-md, 14px);
    padding: 12px 14px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    user-select: none;
}

.all-habit-card:active {
    transform: scale(0.985);
    background: rgba(0, 0, 0, 0.02);
}

.all-habit-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.all-habit-info {
    flex: 1;
    min-width: 0;
}

.all-habit-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary, #20251F);
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.all-habit-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-secondary, #8A8570);
}

.all-habit-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    background: #EFEAD8;
    color: var(--cta, #33513F);
}

.all-habit-pill.shared {
    background: rgba(66, 100, 81, 0.12);
    color: var(--green, #426451);
}

.all-habit-pill.archived {
    background: #EAE6DB;
    color: var(--muted, #928C78);
}

.all-habits-archived-section {
    margin-top: 20px;
}

.all-habits-archived-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #8A8570);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── LEVEL 3: ARKADAŞLAR (Friends Screen) ─────────────────────────────── */
#screen-friends {
    padding-bottom: 24px;
}

.friends-hero-card {
    background: linear-gradient(135deg, rgba(51, 81, 63, 0.08) 0%, rgba(220, 233, 223, 0.3) 100%);
    border: 0.5px solid rgba(51, 81, 63, 0.15);
    border-radius: var(--radius-lg, 16px);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.friends-hero-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--cta, #33513F);
    margin: 0 0 4px 0;
}

.friends-hero-sub {
    font-size: 12px;
    color: var(--text-secondary, #6B7280);
    margin: 0;
    line-height: 1.4;
}

.friends-section-title {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #8A8570);
    text-transform: uppercase;
    margin: 16px 0 8px 0;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.friend-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface, #FFFFFF);
    border: 0.5px solid var(--border, #E4E0D4);
    border-radius: var(--radius-md, 14px);
    padding: 12px 14px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.friend-item-card:active {
    transform: scale(0.985);
}

.friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #EFEAD8;
    color: var(--cta, #33513F);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.invitation-item-card {
    background: var(--bg-surface, #FFFFFF);
    border: 0.5px solid var(--border, #E4E0D4);
    border-radius: var(--radius-md, 14px);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invitation-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-invite-accept {
    background: var(--cta, #33513F);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-invite-decline {
    background: none;
    border: 1px solid var(--border, #E4E0D4);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary, #8A8570);
    cursor: pointer;
}

/* ── NON-BLOCKING ONBOARDING HINT ─────────────────────────────────────── */
.spatial-gesture-hint {
    display: none !important;
}

.spatial-gesture-hint.dismissed {
    animation: spatialHintFadeOut 0.25s ease-in forwards;
    pointer-events: none;
}

.spatial-hint-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    margin-left: 4px;
}

@keyframes spatialHintFadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes spatialHintFadeOut {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, 10px); }
}

/* ── SPATIAL SCREEN HEADERS & TOP BARS ────────────────────────────────── */
.all-habits-top-bar,
.friends-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 2px 0;
}

.spatial-screen-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary, #20251F);
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.spatial-screen-sub {
    font-size: 12px;
    color: var(--text-secondary, #8A8570);
    margin: 2px 0 0 0;
}

.spatial-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-spatial-action {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-surface, #FFFFFF);
    border: 0.5px solid var(--border, #E4E0D4);
    color: var(--text-primary, #20251F);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.15s ease;
}

.btn-spatial-action:active {
    transform: scale(0.92);
    background: rgba(0,0,0,0.04);
}

/* ── ALL HABITS: CONTROLS & FILTER PILLS ──────────────────────────────── */
.all-habits-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.all-habits-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.all-habits-filter-pills::-webkit-scrollbar {
    display: none;
}

.all-habits-filter-pill {
    padding: 5px 12px;
    border-radius: var(--radius-full, 9999px);
    border: 0.5px solid var(--border, #E4E0D4);
    background: var(--bg-surface, #FFFFFF);
    color: var(--text-secondary, #8A8570);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.all-habits-filter-pill.active {
    background: var(--cta, #33513F);
    color: #FFFFFF;
    border-color: var(--cta, #33513F);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(51, 81, 63, 0.2);
}

.all-habits-sort-wrapper {
    flex-shrink: 0;
}

.all-habits-sort-select {
    padding: 5px 8px;
    border-radius: 8px;
    border: 0.5px solid var(--border, #E4E0D4);
    background: var(--bg-surface, #FFFFFF);
    color: var(--text-secondary, #8A8570);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

/* ── ALL HABITS: CARD ENHANCEMENTS (Streak & 7-Day Mini Dots) ───────────── */
.all-habit-top-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.all-habit-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    background: #FEF3C7;
    color: #B45309;
    flex-shrink: 0;
}

.all-habit-dots-row {
    margin-top: 6px;
    display: flex;
    align-items: center;
}

.mini-completion-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    background: #EAE6DB;
    display: inline-block;
    transition: transform 0.15s ease;
}

.mini-dot.completed {
    background: var(--cta, #33513F);
}

.all-habit-pill.paused {
    background: #FEE2E2;
    color: #DC2626;
}

.all-habit-card.is-paused {
    opacity: 0.75;
}

/* ── TODAY SCREEN: SHARED BADGE ────────────────────────────────────────── */
.today-habit-collab-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--cta, #33513F);
    background: rgba(51, 81, 63, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

/* ── LEVEL 3: FRIEND DETAIL SUB-VIEW ──────────────────────────────────── */
.friend-detail-nav {
    margin-bottom: 14px;
}

.btn-friend-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 4px 6px 4px 0;
    color: var(--cta, #33513F);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
}

.btn-friend-detail-back:active {
    opacity: 0.7;
}

.friend-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    background: var(--bg-surface, #FFFFFF);
    border: 0.5px solid var(--border, #E4E0D4);
    border-radius: var(--radius-lg, 18px);
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.friend-detail-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #EFEAD8;
    color: var(--cta, #33513F);
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.friend-detail-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary, #20251F);
    margin: 0 0 2px 0;
}

.friend-detail-sub {
    font-size: 12.5px;
    color: var(--text-secondary, #8A8570);
    margin: 0;
}

.friend-detail-section {
    margin-bottom: 24px;
}

.friend-detail-shared-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-friend-add-shared {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md, 12px);
    border: 1px dashed var(--border, #E4E0D4);
    background: var(--bg-surface-light, #FAF8F5);
    color: var(--cta, #33513F);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease;
}

.btn-friend-add-shared:active {
    background: #EFEAD8;
}

.friend-detail-danger-zone {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 0.5px solid var(--border, #E4E0D4);
    text-align: center;
}

.btn-friend-remove {
    background: none;
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #DC2626;
    padding: 9px 18px;
    border-radius: var(--radius-md, 10px);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-friend-remove:active {
    background: #FEE2E2;
}

/* ── PENDING INVITATIONS BANNER ────────────────────────────────────────── */
.pending-invites-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.pending-invites-badge {
    background: #EF4444;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── FRIENDS EMPTY STATE & STATE-DRIVEN VISIBILITY ───────────────────── */
[data-friend-state="empty"] .friends-hero-card,
[data-friend-state="empty"] #friends-hero-card,
[data-friend-state="empty"] .friends-activity-wrapper,
[data-friend-state="empty"] #friends-activity-wrapper,
[data-friend-state="empty"] .friends-people-wrapper,
[data-friend-state="empty"] #friends-people-wrapper,
[data-friend-state="empty"] .friends-header-add-btn,
[data-friend-state="empty"] #friends-add-action-btn {
    display: none !important;
}

[data-friend-state="active"] .friends-empty-state,
[data-friend-state="active"] #friends-empty-state {
    display: none !important;
}

[data-has-activity="false"] #friends-activity-wrapper,
[data-has-activity="false"] .friends-activity-wrapper {
    display: none !important;
}

.friends-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 18px;
    background: var(--bg-surface, #FFFFFF);
    border: 0.5px solid var(--border, #E4E0D4);
    border-radius: var(--radius-lg, 16px);
    text-align: center;
    margin-top: 10px;
}

.friends-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-surface-secondary, rgba(51, 81, 63, 0.08));
    color: var(--cta, #33513F);
    margin-bottom: 12px;
}

.friends-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #20251F);
    margin: 0 0 6px;
}

.friends-empty-desc {
    font-size: 13px;
    color: var(--text-secondary, #6B7280);
    margin: 0 0 18px;
    text-align: center;
    line-height: 1.45;
    max-width: 290px;
}

#friends-empty-add-btn {
    font-size: 13px;
    padding: 10px 22px;
    border-radius: 9999px;
    font-weight: 600;
}


/* Habit inventory: independent filters and native keyboard actions. */
.all-habits-search-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.all-habits-search { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface); color: var(--text-primary); font: inherit; }
.all-habits-facets { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 12px; }
.all-habits-facets select { flex: 1; min-width: 0; max-width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-surface); color: var(--text-primary); padding: 8px; }
#screen-all-habits .all-habits-controls-row { flex-wrap: wrap; }
#screen-all-habits .all-habits-filter-pill, #screen-all-habits .all-habits-sort-select { min-height: 44px; }
.all-habits-results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 12px; color: var(--text-secondary); font-size: 12px; }
#all-habits-clear { border: 0; background: transparent; color: var(--text-primary); min-height: 44px; text-decoration: underline; }
#screen-all-habits .all-habit-card { text-align: left; font: inherit; color: var(--text-primary); }
#screen-all-habits div.all-habit-card { padding: 0; gap: 0; }
.all-habit-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 14px 8px 14px 14px; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; border-radius: inherit; }
.all-habit-edit { flex: 0 0 auto; min-height: 44px; padding: 8px; margin-right: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); font-size: 12px; cursor: pointer; }
#screen-all-habits :is(button, input, select):focus-visible { outline: 2px solid var(--cta, #33513F); outline-offset: 2px; }
#screen-all-habits .all-habit-meta, #screen-all-habits .all-habit-top-line { flex-wrap: wrap; }
#screen-all-habits .all-habit-title { overflow-wrap: anywhere; }
