/* ============================================
   Okini - Fashion Swipe App
   Mobile-first responsive stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #FAF7F2;
    --bg-secondary: #FFFFFF;
    --bg-card: #F0EBE3;
    --bg-surface: #EDE8E0;
    --accent-pink: #C4405A;
    --accent-green: #3A9E7E;
    --accent-blue: #4A6FA5;
    --text-primary: #2D2926;
    --text-secondary: #6B6560;
    --text-muted: #A09A94;
    --like-color: #3A9E7E;
    --dislike-color: #C4405A;
    --shadow-card: 0 4px 20px rgba(45, 41, 38, 0.08);
    --shadow-btn: 0 2px 10px rgba(45, 41, 38, 0.10);
    --radius-card: 20px;
    --radius-btn: 50%;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 60px;
    --header-height: 48px;
    --accent: var(--accent-pink);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-bg-strong: rgba(255, 255, 255, 0.92);
    --glass-bg-accent: rgba(196, 64, 90, 0.08);
    --glass-border: rgba(45, 41, 38, 0.08);
    --glass-blur: blur(16px);
    --glass-blur-light: blur(8px);
    --glass-shadow: 0 4px 24px rgba(45, 41, 38, 0.10);
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100%;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

/* --- Header --- */
.app-header {
    height: var(--header-height);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-login {
    color: var(--accent-pink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border: 1px solid var(--accent-pink);
    border-radius: 20px;
    transition: var(--transition-fast);
}

.header-login:active {
    background: var(--accent-pink);
    color: #fff;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.logout-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
}

.lang-toggle {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}

.lang-toggle:active {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* --- Auth Modal --- */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 41, 38, 0.4);
}

.auth-dialog {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 32px 24px;
    width: 90%;
    max-width: 380px;
    box-shadow: var(--glass-shadow);
}

.auth-title {
    text-align: center;
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.auth-error {
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid var(--accent-pink);
    color: var(--accent-pink);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

.auth-success {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    text-align: center;
}

.auth-forgot {
    text-align: center;
    margin-top: 8px;
}

.auth-forgot a {
    color: var(--text-muted);
    font-size: 13px;
}

.verify-description {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--bg-surface);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--accent-pink);
}

.auth-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-pink), #D4687A);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity var(--transition-fast);
}

.auth-submit:active {
    opacity: 0.8;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-pink);
    text-decoration: none;
    font-weight: 600;
}

.app-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-pink), #D4687A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.app-subtitle {
    display: none;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* --- Views --- */
.view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding-bottom: var(--nav-height);
    min-height: 0;
}

#view-liked,
#view-disliked,
#view-top,
#view-friends {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.view.active {
    display: flex;
}

.view-title {
    font-size: 20px;
    font-weight: 700;
    padding: 16px 20px 8px;
    color: var(--text-primary);
}

/* --- Filter Chips --- */
.filters-container {
    padding: 2px 0 0;
    flex-shrink: 0;
}

.filter-row-wrapper {
    position: relative;
    margin: 0 16px;
}

.filter-row-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, transparent, var(--bg-primary) 80%);
    pointer-events: none;
    z-index: 1;
}

.filter-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px 0;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

.filter-group {
    display: contents;
}

.category-btn {
    margin-left: auto;
}

/* --- Category Popup --- */
.category-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 41, 38, 0.3);
    z-index: 100;
}

.category-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: var(--bg-secondary);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(45, 41, 38, 0.12);
    z-index: 101;
    display: flex;
    flex-direction: column;
    animation: popupSlideUp 0.25s ease-out;
}

@keyframes popupSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.category-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--glass-border);
}

.category-popup-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.category-popup-list {
    overflow-y: auto;
    padding: 12px 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-popup-list .filter-chip {
    padding: 8px 16px;
    font-size: 13px;
}

.filter-chip {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid var(--text-muted);
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-chip.active {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
    color: #fff;
}

/* --- Card Source Badge --- */
.card-source {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    z-index: 4;
    transition: background var(--transition-fast);
    pointer-events: auto;
}

.card-source:active,
.card-source:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
}

.grid-item-source {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.grid-item-source a {
    color: var(--text-muted);
    text-decoration: none;
}

/* --- Share Overlay --- */
.overlay-share {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(139, 92, 246, 0.6));
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
}

/* --- Card Container (Swipe View) --- */
.card-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 16px;
    position: relative;
    overflow: hidden;
}

/* --- Fashion Card --- */
.fashion-card {
    width: 100%;
    max-width: 380px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
    cursor: grab;
    will-change: transform;
    transition: none;
    touch-action: none;
}

.fashion-card.animate-back {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fashion-card.animate-out {
    transition: transform 0.4s ease-in, opacity 0.4s ease-in;
    pointer-events: none;
}

.fashion-card.animate-enter {
    animation: cardEnter 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.fashion-card.hidden {
    display: none;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #F5F0EA;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    display: block;
}

/* --- Swipe Overlays --- */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
    z-index: 5;
}

.overlay-like {
    background: linear-gradient(135deg, rgba(78, 204, 163, 0.85), rgba(78, 204, 163, 0.6));
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
}

.overlay-dislike {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.85), rgba(233, 69, 96, 0.6));
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
}

.overlay-icon {
    font-size: 72px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.overlay-text {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: 8px;
}

/* --- Card Info --- */
.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
    border-top: 1px solid var(--glass-border);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-info-text {
    flex: 1;
    min-width: 0;
}

.card-info-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-brand {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.card-category,
.card-score {
    display: none;
}

/* --- Action Buttons (inside card-info) --- */
.action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-btn);
    border: 2px solid;
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.action-btn:active::before {
    opacity: 1;
}

.btn-like {
    border-color: var(--like-color);
    color: var(--like-color);
}

.btn-like::before {
    background: var(--like-color);
}

.btn-like:active {
    color: #fff;
    transform: scale(1.1);
}

.btn-dislike {
    border-color: var(--dislike-color);
    color: var(--dislike-color);
}

.btn-dislike::before {
    background: var(--dislike-color);
}

.btn-dislike:active {
    color: #fff;
    transform: scale(1.1);
}

.btn-icon {
    font-size: 22px;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.swipe-hint {
    display: none;
}

/* --- Empty State --- */
.empty-state, .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.empty-state.hidden, .loading-state.hidden {
    display: none;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--like-color);
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 260px;
    line-height: 1.5;
}

/* --- Loading Spinner --- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-surface);
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* --- Items Grid (Liked / Disliked / Top) --- */
.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
}

.grid-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
}

.grid-item:active {
    opacity: 0.8;
}

.grid-item-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--bg-surface);
}

.grid-item-info {
    display: none;
}

.grid-item-rank {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-pink);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.5);
}

.grid-item.ranked {
    position: relative;
}

/* --- Item Detail Modal --- */
.item-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 41, 38, 0.6);
    padding: 0;
}

.item-detail-modal.hidden {
    display: none;
}

.item-detail-content {
    width: 100%;
    max-width: 500px;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.item-detail-close {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 210;
    background: rgba(45, 41, 38, 0.5);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.item-detail-image {
    width: 100%;
    display: block;
    background: var(--bg-surface);
}

.item-detail-info {
    padding: 16px 20px;
    background: var(--bg-secondary);
}

.item-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.item-detail-brand {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.item-detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.item-detail-category {
    font-size: 12px;
    color: var(--accent-pink);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-detail-score {
    font-size: 13px;
    color: var(--text-secondary);
}

.item-detail-source a {
    font-size: 13px;
    color: var(--accent-green);
    text-decoration: none;
}

.item-detail-source a:active {
    opacity: 0.7;
}

/* --- List Empty State --- */
.list-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
    text-align: center;
}

.list-empty.hidden {
    display: none;
}

.list-empty p {
    font-size: 15px;
    color: var(--text-muted);
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -2px 12px rgba(45, 41, 38, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
    margin: 0 auto;
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    min-height: 48px;
    position: relative;
}

.nav-tab::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 32px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent-pink);
    transition: transform var(--transition-normal);
}

.nav-tab.active {
    color: var(--accent-pink);
}

.nav-tab.active::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-icon {
    font-size: 22px;
    line-height: 1;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- Friends View --- */
.friends-container {
    padding: 0 16px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.friend-search {
    position: relative;
    margin-bottom: 16px;
}

.friend-search-field {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--bg-surface);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.friend-search-field:focus {
    border-color: var(--accent-pink);
}

.friend-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(45, 41, 38, 0.12);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--bg-surface);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.friend-add-btn {
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #5b9bd5;
    background: transparent;
    color: #5b9bd5;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.friend-add-btn:active {
    background: #5b9bd5;
    color: #fff;
}

.friend-section {
    margin-bottom: 20px;
}

.friend-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.friend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.friend-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.friend-actions {
    display: flex;
    gap: 8px;
}

.friend-accept-btn {
    padding: 4px 12px;
    border-radius: 12px;
    border: none;
    background: var(--accent-green);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.friend-reject-btn {
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--dislike-color);
    background: transparent;
    color: var(--dislike-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* --- Inbox --- */
.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inbox-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
    align-items: center;
}

.inbox-item.unseen {
    border-left: 3px solid var(--accent-pink);
}

.inbox-item-image {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.inbox-item-info {
    flex: 1;
    min-width: 0;
}

.inbox-item-from {
    font-size: 12px;
    color: var(--accent-pink);
    font-weight: 600;
    margin-bottom: 2px;
}

.inbox-item-title {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item-message {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 2px;
}

/* --- Share Modal --- */
.share-dialog {
    max-height: 80vh;
    overflow-y: auto;
}

.share-item-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 16px;
}

.share-preview-image {
    width: 50px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
}

.share-preview-title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.share-friends-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.share-friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.share-friend-item:active {
    background: var(--bg-surface);
}

.share-friend-name {
    color: var(--text-primary);
    font-size: 14px;
}

.share-send-icon {
    color: var(--accent-pink);
    font-size: 18px;
}

.share-message-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--bg-surface);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.share-message-input:focus {
    border-color: var(--accent-pink);
}

.share-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Unseen Badge --- */
.unseen-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(12px);
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: var(--accent-pink);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Scrollbar styling --- */

/* --- Responsive adjustments --- */

/* Small phones */
@media (max-height: 640px) {
    .app-header {
        height: 40px;
        padding: 2px 12px;
    }

    .app-title {
        font-size: 18px;
    }

    .app-subtitle {
        display: none;
    }

    .card-container {
        padding: 2px 12px;
    }

    .action-btn {
        width: 36px;
        height: 36px;
    }

    .btn-camera {
        width: 30px;
        height: 30px;
    }

    .btn-icon {
        font-size: 18px;
    }

    .btn-camera .btn-icon {
        font-size: 14px;
    }

    :root {
        --nav-height: 52px;
    }
}

/* Larger screens */
@media (min-width: 500px) {
    .bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        width: 500px;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .app-header {
        height: 40px;
    }

    .app-subtitle {
        display: none;
    }

    :root {
        --nav-height: 56px;
    }
}

/* --- Hover effects for non-touch devices --- */
@media (hover: hover) {
    .action-btn:hover {
        transform: scale(1.08);
    }

    .btn-like:hover {
        background: rgba(78, 204, 163, 0.12);
    }

    .btn-dislike:hover {
        background: rgba(233, 69, 96, 0.12);
    }

    .nav-tab:hover {
        color: var(--text-secondary);
    }

    .grid-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(45, 41, 38, 0.12);
    }
}

/* Shared item badge on card */
.card-shared-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(45, 41, 38, 0.12);
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    z-index: 10;
}

.shared-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.shared-from-label {
    color: var(--text-primary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.shared-message-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(45, 41, 38, 0.12);
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 2s infinite;
}

.shared-message-btn .message-icon {
    font-size: 1.2rem;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 64, 90, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(196, 64, 90, 0); }
}

.shared-message-popup {
    position: absolute;
    top: 60px;
    right: 12px;
    max-width: 250px;
    background: var(--bg-secondary);
    box-shadow: 0 4px 16px rgba(45, 41, 38, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    z-index: 11;
    animation: fade-in 0.2s ease;
}

.shared-message-popup p {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
    font-style: italic;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toast notification */
.toast-message {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: #fff;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.toast-message.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Camera Button --- */
.btn-camera {
    width: 34px;
    height: 34px;
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
}

.btn-camera::before {
    background: #8b5cf6;
}

.btn-camera:active {
    color: #fff;
    transform: scale(1.1);
}

.btn-camera .btn-icon {
    font-size: 16px;
}

/* --- Photo Upload Modal --- */
.photo-dialog {
    max-height: 85vh;
    overflow-y: auto;
}

.photo-preview-container {
    position: relative;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-primary);
}

.photo-preview-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.photo-retake-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 12px;
    border-radius: 12px;
    border: none;
    background: rgba(45, 41, 38, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.photo-capture-area {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.photo-capture-btn,
.photo-gallery-btn {
    flex: 1;
    padding: 20px 12px;
    border-radius: 12px;
    border: 2px dashed var(--text-muted);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.photo-capture-btn:active,
.photo-gallery-btn:active {
    border-color: var(--accent-pink);
}

/* Multi-select friends in photo modal */
.photo-friend-item {
    position: relative;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.photo-friend-check {
    color: var(--text-muted);
    font-size: 18px;
    transition: color var(--transition-fast);
}

.photo-friend-item.selected {
    background: var(--bg-surface);
    border-color: var(--accent-green);
}

.photo-friend-item.selected .photo-friend-check {
    color: var(--accent-green);
}

.auth-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===========================
   Settings
   =========================== */

.settings-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    padding: 0;
    line-height: 1;
}

.settings-btn:active {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.settings-dialog {
    max-height: 80vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.settings-profile-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.settings-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-avatar-initial {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-secondary);
}

.settings-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-action-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--accent-pink);
    background: transparent;
    color: var(--accent-pink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.settings-action-btn:active {
    background: var(--accent-pink);
    color: #fff;
}

.settings-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-action-btn-danger {
    border-color: var(--dislike-color);
    color: var(--dislike-color);
}

.settings-action-btn-danger:active {
    background: var(--dislike-color);
    color: #fff;
}

/* Toggle Switch */
.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-primary);
    border-radius: 12px;
}

.settings-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-toggle-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-surface);
    border-radius: 26px;
    transition: var(--transition-normal);
}

.settings-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition-normal);
}

.settings-switch input:checked + .settings-slider {
    background: var(--accent-green);
}

.settings-switch input:checked + .settings-slider::before {
    transform: translateX(22px);
    background: #fff;
}

/* ===========================
   Friend Avatars & Likes
   =========================== */

.friend-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.friend-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-avatar-initial {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

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

.friend-likes-btn {
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--accent-pink);
    background: transparent;
    color: var(--accent-pink);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.friend-likes-btn:active {
    background: var(--accent-pink);
    color: #fff;
}

/* Follow buttons */
.follow-btn {
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--accent-green);
    background: transparent;
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.follow-btn:active {
    background: var(--accent-green);
    color: #fff;
}

.follow-btn.following {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.follow-btn.following:active {
    background: var(--dislike-color);
    border-color: var(--dislike-color);
    color: #fff;
}

.follow-unfollow-btn {
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--text-muted);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.follow-unfollow-btn:active {
    background: var(--dislike-color);
    border-color: var(--dislike-color);
    color: #fff;
}

.search-result-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.friend-name-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.following-likes-status {
    font-size: 11px;
    color: var(--text-muted);
}

.following-likes-status.visible {
    color: var(--accent-green);
}

.friend-likes-dialog {
    max-height: 85vh;
    overflow-y: auto;
    width: 95%;
    max-width: 420px;
}

.friend-likes-grid {
    max-height: 60vh;
    overflow-y: auto;
}

/* --- Fallback for unsupported browsers --- */
@supports not (backdrop-filter: blur(1px)) {
    .card-info {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* ===========================
   Tutorial / Onboarding
   =========================== */

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: all;
}

.tutorial-overlay.tutorial-visible {
    opacity: 1;
}

.tutorial-overlay.tutorial-fade-out {
    opacity: 0;
    pointer-events: none;
}

.tutorial-spotlight {
    position: absolute;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    background: transparent;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    pointer-events: none;
}

.tutorial-tooltip {
    position: absolute;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    max-width: 320px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    width: calc(100vw - 24px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    transition: opacity 0.3s ease, top 0.4s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-tooltip::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--bg-secondary);
    transform: rotate(45deg);
    left: 50%;
    margin-left: -7px;
}

.tutorial-tooltip-bottom::before {
    top: -7px;
}

.tutorial-tooltip-top::before {
    bottom: -7px;
}

.tutorial-icon {
    font-size: 32px;
    margin-bottom: 8px;
    line-height: 1;
}

.tutorial-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.tutorial-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.tutorial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-dots {
    display: flex;
    gap: 6px;
}

.tutorial-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg-surface);
    transition: background 0.2s;
}

.tutorial-dot.active {
    background: var(--accent-pink);
    transform: scale(1.2);
}

.tutorial-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tutorial-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 10px;
}

.tutorial-next {
    background: var(--accent-pink);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.tutorial-next:active {
    transform: scale(0.95);
}

/* Swipe hint animations on the spotlight */
@keyframes tutorial-hint-left {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-24px); }
}

@keyframes tutorial-hint-right {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(24px); }
}

@keyframes tutorial-hint-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.tutorial-anim-swipe-left {
    animation: tutorial-hint-left 1.5s ease-in-out infinite;
}

.tutorial-anim-swipe-right {
    animation: tutorial-hint-right 1.5s ease-in-out infinite;
}

.tutorial-anim-swipe-up {
    animation: tutorial-hint-up 1.5s ease-in-out infinite;
}

/* ===========================
   Signup Nudge
   =========================== */

.signup-nudge {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.signup-nudge.visible {
    opacity: 1;
}

.signup-nudge-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.signup-nudge.visible .signup-nudge-content {
    transform: scale(1);
}

.signup-nudge-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
}

.signup-nudge-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.signup-nudge-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.signup-nudge-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.signup-nudge-btn {
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform var(--transition-fast);
}

.signup-nudge-btn:active {
    transform: scale(0.97);
}

.signup-nudge-signup {
    background: var(--accent-pink);
    color: #fff;
}

.signup-nudge-skip {
    background: transparent;
    color: var(--text-muted);
}
