/* css/components.css */

/* --- 1. The Glass Card --- */
.glass-panel {
    background: var(--glass-base);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--glass-radius);
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s var(--ease-ios), box-shadow 0.3s var(--ease-ios), opacity 0.3s ease;
    /* Added opacity transition */
}

.glass-panel:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12);
    border-color: rgba(255, 255, 255, 0.8);
}

.btn-primary {
    background: var(--text-primary);
    color: white;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-ios);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: #ff3b30;
    color: white;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s var(--ease-ios);
}

.filter-chip {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    /* Pill shape */
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    height: 36px;
    /* Smaller height */
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- 3. Floating Header --- */
.floating-header {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1100px;
    height: 70px;
    z-index: 1000;
    display: none;
    /* Hidden by default, toggled by JS */
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;

    background: rgba(255, 255, 255, 0.75);
    /* More opaque for premium feel */
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 100px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
/* Header Animations */
.brand-logo:hover {
    transform: rotate(10deg) scale(1.1);
}
.brand-logo-small {
    height: 40px;
    width: auto;
    border-radius: 8px;
    transition: transform 0.2s;
    object-fit: contain;
    background: transparent;
}

.brand-logo-small:hover {
    transform: scale(1.05);
}

/* --- Welcome / Hero Screen (REDESIGN) --- */
.welcome-container {
    height: 100vh;
    /* Use full height */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* --- Animations & Microinteractions (NEW) --- */

/* Pop & Scale (Buying) */
@keyframes pop-scale {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
        filter: grayscale(0.5);
    }
}

.anim-buying {
    animation: pop-scale 0.6s var(--ease-spring) forwards;
    pointer-events: none;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Fade Out & Shrink (Deleting/Removing) */
@keyframes fade-out-shrink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

.anim-delete {
    animation: fade-out-shrink 0.3s ease-out forwards;
    pointer-events: none;
}

/* Staggered Entry (Inspo) */
@keyframes stagger-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item {
    animation: stagger-up 0.5s var(--ease-ios) backwards;
}

/* Friends & Search */
.friend-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Profile Header in Friend View */
.profile-header-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
}

/* A glow behind the card for atmosphere */
.premium-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.auth-card {
    width: 90%;
    max-width: 440px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeUp 0.8s var(--ease-ios);
    z-index: 1;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    border-radius: 32px;
}

/* Lighter Card Variant (Milestone 1) */
.lighter-card {
    padding: 40px 32px;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(25px) saturate(180%);
    border-radius: 28px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
}

/* Brand Section */
.brand-hero {
    margin-bottom: 40px;
    animation: float 6s ease-in-out infinite;
    text-align: center;
}

.brand-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 8px;
    filter: drop-shadow(0 10px 20px rgba(100, 100, 255, 0.2));
}

.hero-icon-small {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    object-fit: contain;
}

.compact-hero {
    margin-bottom: 24px;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 8px;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #1D1D1F 0%, #555 100%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
}

.compact-title {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.hero-brand-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.compact-subtitle {
    font-size: 0.95rem;
    margin-top: 8px;
    opacity: 0.8;
}

/* Auth Segmented Control */
.auth-tabs {
    background: rgba(0, 0, 0, 0.03);
    padding: 6px;
    border-radius: 16px;
    display: flex;
    width: 100%;
    margin-bottom: 32px;
}

.compact-tabs {
    margin-bottom: 20px;
    padding: 4px;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s var(--ease-ios);
}

.auth-tab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.social-divider {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 24px 0;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.compact-divider {
    margin: 16px 0;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.social-divider span {
    padding: 0 12px;
}

.btn-group {
    display: flex;
    gap: 12px;
    /* Add space between buttons */
    align-items: center;
}

/* Google Button Style */
.btn-google {
    background: white;
    color: #1D1D1F;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-google:hover {
    background: #f8f8f8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* --- Header Actions --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

/* --- User Avatar --- */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

.user-avatar:hover {
    transform: scale(1.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* --- Skeleton Loading --- */
.skeleton-card {
    pointer-events: none;
}

.skeleton-img {
    height: 180px;
    border-radius: 16px;
    margin-bottom: 16px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

.skeleton-text {
    height: 16px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text.title {
    width: 70%;
}

.skeleton-text.meta {
    width: 40%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* --- Floating Action Button (FAB) --- */
.fab-add {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--text-primary);
    color: white;
    border: none;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s var(--ease-ios);
    z-index: 100;
}

.fab-add:hover {
    transform: scale(1.1);
}

/* --- MODAL STYLING --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; }

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    width: 90%; max-width: 500px;
    padding: 32px;
    border-radius: 32px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-overlay.active .modal-content { transform: scale(1); }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.modal-header h3 { margin: 0; font-size: 1.4rem; }

/* Specific Price/Currency Styling */
#input-price {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 12px;
    text-align: center;
    letter-spacing: 0.5px;
}

#input-currency {
    font-weight: 600;
    padding: 12px;
    text-align: center;
    cursor: pointer;
}


@media (max-width: 480px) {
    .modal-content {
        padding: 24px;
        max-height: 90vh;
    }
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-shrink: 0;
}

.close-btn {
    background: rgba(0,0,0,0.05);
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.close-btn:hover { background: rgba(0,0,0,0.1); color: var(--text-primary); }

/* --- Form Styles --- */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.compact-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

input,
select {
    width: 100%;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.6);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.compact-group input {
    padding: 12px 12px 12px 42px;
    font-size: 0.95rem;
    border-radius: 12px;
}

.compact-btn {
    padding: 12px;
    font-size: 0.95rem;
}

input:focus,
select:focus {
    outline: none;
    background: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: translateY(-1px);
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-left: 48px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.4;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 40px;
    flex-shrink: 0;
    padding-bottom: 10px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-primary);
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.05);
}

/* --- Card Styles (Updates) --- */
.card {
    display: inline-block;
    width: 100%;
    margin-bottom: 24px;
    break-inside: avoid;
    background: var(--glass-base);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s var(--ease-ios);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

/* Make actions appear on hover */
.card .card-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card:hover .card-actions {
    opacity: 1;
}

/* Mobile: always show actions or use specific touch logic. 
   For simplicity, keeping hover logic for desktop, 
   touch devices usually simulate hover on first tap. */
@media (hover: none) {
    .card .card-actions {
        opacity: 1;
    }
}

.card-img-container {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.03);
}

.card-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.card:hover .card-img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
}

.card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Card Action Button --- */
.card-action-btn {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s var(--ease-ios);
}

.card:hover .card-action-btn {
    opacity: 1;
    transform: scale(1);
}

.card-action-btn:hover {
    transform: scale(1.1) !important;
}

.delete-btn {
    color: #ff3b30;
}

.delete-btn:hover {
    background: #ff3b30;
    color: white;
}

.edit-btn {
    color: #007AFF;
}

.edit-btn:hover {
    background: #007AFF;
    color: white;
}

.closet-btn {
    color: #34C759;
}

.closet-btn:hover {
    background: #34C759;
    color: white;
}

.pin-btn {
    color: #AF52DE;
}

.gift-btn {
    color: #34C759;
}

.gift-btn:hover {
    background: #34C759;
    color: white;
}

/* --- AI Companion --- */
.ai-companion {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.ai-avatar-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
    transition: transform 0.2s;
    pointer-events: auto;
    cursor: pointer;
}

.ai-avatar-container:hover {
    transform: scale(1.1) rotate(5deg);
}

.ai-mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s var(--ease-spring);
}

.ai-message-bubble {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: 14px 20px;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 240px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transform-origin: bottom left;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 40px;
    pointer-events: auto;
}

.ai-companion.active .ai-message-bubble {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 600px) {
    .ai-companion {
        bottom: 80px;
        left: 10px;
    }

    .ai-avatar-container {
        width: 60px;
        height: 60px;
    }
}

/* --- Boards & Dashboard --- */
.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    padding-bottom: 80px;
}

.board-card {
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
}

.board-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.board-cover {
    height: 150px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.05);
}

.dashed-cover {
    border: 2px dashed rgba(0, 0, 0, 0.1);
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-secondary);
}

.board-info {
    padding: 16px;
}

.board-info h3 {
    font-size: 1rem;
    margin: 0;
}

.board-info p {
    font-size: 0.8rem;
    margin-top: 4px;
    color: var(--text-tertiary);
}

.dashboard-widget {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 24px;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.stat-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
}

/* Board Preview Grid (2x2) */
.board-preview-grid {
    height: 140px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
    background: rgba(0,0,0,0.05);
    overflow: hidden;
}

.board-preview-grid > div {
    background-size: cover;
    background-position: center;
    background-color: #eee;
    transition: transform 0.3s;
}

.board-preview-grid.count-1 > div {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

.board-preview-grid.count-2 > div:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1 / -1;
}
.board-preview-grid.count-2 > div:nth-child(2) {
    grid-column: 2 / 3;
    grid-row: 1 / -1;
}

.board-preview-grid.count-3 > div:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1 / -1;
}

.board-card:hover .board-preview-grid > div {
    transform: scale(1.05);
}

.board-cover-placeholder {
    height: 140px;
    background: rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}
.board-cover-placeholder::after {
    content: '📌';
    font-size: 2rem;
    opacity: 0.3;
}

/* Pin Candidate in Add Modal */
.pin-candidate {
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}
.pin-candidate:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
}

/* Pin Actions Overlay */
.pin-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
}
.pin-item:hover .pin-actions {
    opacity: 1;
}
.pin-actions .icon-btn {
    background: rgba(255,255,255,0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.pin-actions .icon-btn:hover {
    transform: scale(1.1);
}

/* --- Card Badges & States --- */
.card-owned {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
}

.card-owned img {
    filter: grayscale(30%);
}

.inspo-masonry .pin-item {
    margin-bottom: 16px;
    border-radius: 16px;
    overflow: hidden;
    break-inside: avoid;
}

.inspo-masonry img {
    width: 100%;
    display: block;
    border-radius: 16px;
    transition: transform 0.3s;
}

.inspo-masonry img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Gift Mode Glow */
.card-gift {
    border: 1.5px solid rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.15) !important;
}

.card-gift:hover {
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.25) !important;
}

.card-gifted {
    border: 2px solid #FFD700 !important;
    background: rgba(255, 215, 0, 0.15) !important;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.2) !important;
    transform: scale(1.02);
}

/* View Transition Fade */
.grid-transition-fade {
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gift-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(255, 165, 0, 0.3);
}

.gift-badge::before {
    content: "🎁";
}

.card-locked {
    opacity: 0.5;
    filter: grayscale(100%);
    pointer-events: none;
    border: 1px dashed rgba(0, 0, 0, 0.2);
}

.card-locked .card-action-btn {
    display: none;
}

/* --- Tags & Chips --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.cat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-pill:hover {
    background: rgba(255, 255, 255, 0.7);
}

.cat-pill.selected {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
    transform: scale(1.05);
}

.cat-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.cat-name {
    font-size: 0.75rem;
    font-weight: 600;
}

.subcategory-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.sub-chip {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.sub-chip.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Price Row Layout - Fix for "Collapsed" look */
.price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.03);
    padding: 8px;
    border-radius: 16px;
    margin-bottom: 16px;
    width: 100%; /* Force full width */
}

.price-row input {
    flex: 2; /* Take up more space */
    min-width: 0; /* Prevent flex blowout */
    text-align: right;
    font-weight: 700;
    font-size: 1.2rem;
    border: none;
    box-shadow: none;
    background: white;
    border-radius: 12px;
}

.price-row select {
    flex: 1;
    min-width: 80px;
    font-weight: 600;
    text-align: center;
    border: none;
    box-shadow: none;
    background: white;
    border-radius: 12px;
    cursor: pointer;
}


/* Header Animations */
.brand-logo-small:hover {
    transform: rotate(10deg) scale(1.1);
}

.priority-segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 12px;
}

.priority-segmented-control label {
    flex: 1;
    margin: 0;
    text-align: center;
}

.priority-segmented-control input {
    display: none;
}

.priority-segmented-control span {
    display: block;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-secondary);
}

.priority-segmented-control input:checked+span {
    background: white;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.savings-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-style: italic;
}

/* --- View Toggle --- */
.view-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 12px;
    margin-left: 16px;
}

.toggle-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.toggle-btn.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- Timeline --- */
.timeline-container {
    position: relative;
    padding: 20px 0;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(0, 0, 0, 0.1);
    transform: translateX(-50%);
}

.timeline-group {
    margin-bottom: 40px;
    position: relative;
}

.timeline-header {
    background: var(--glass-base);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.timeline-item {
    margin-bottom: 24px;
    position: relative;
    width: 100%;
}

/* --- Magic Button --- */
.btn-magic {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
}

.btn-magic:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.6);
}

.btn-magic:active {
    transform: scale(0.95);
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Overlay Badges --- */
.card-overlay-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

/* --- Badges --- */
.time-tag {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.time-tag.tag-urgent {
    color: #FF3B30;
    background: #FFF0F0;
}

.time-tag.tag-soon {
    color: #FF9500;
    background: #FFF8F0;
}

.time-tag.tag-far {
    color: #007AFF;
    background: #F0F8FF;
}

.time-tag.tag-overdue {
    color: #FFFFFF;
    background: #FF3B30;
}

.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FF3B30;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.3);
}

.tag-sale {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 215, 0, 0.9);
    color: #5a4a00;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 10;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.sale-price {
    color: #E68A00;
    font-weight: 700;
}

/* Add Pin Tile in Grid */
.add-pin-tile {
    transition: all 0.3s var(--ease-ios);
}
.add-pin-tile:hover {
    background: rgba(255,255,255,0.7) !important;
    border-color: var(--accent-color) !important;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
/* --- Ads --- */
.ad-wrapper {
    width: 100%;
    margin-bottom: 24px;
    break-inside: avoid;
}

.ad-slot {
    padding: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1px dashed var(--accent-color);
}

.ad-badge {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.ad-content h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.ad-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.ad-side-banner {
    position: fixed;
    top: 120px;
    width: 160px;
    height: 600px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    z-index: 90;
    transition: opacity 0.3s;
}

.ad-side-banner.left {
    left: 20px;
}

.ad-side-banner.right {
    right: 20px;
}

@media (max-width: 1500px) {
    .ad-side-banner {
        display: none;
    }
}

/* --- Content & Empty States --- */
#content-area {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* --- Empty States --- */
.empty-state-card {
    text-align: center;
    padding: 48px 24px;
    margin: 32px auto;
    max-width: 400px;
    animation: fadeUp 0.5s ease-out;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    animation: float 5s ease-in-out infinite;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.empty-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Combo & AI Results --- */
.combo-layout {
    display: flex;
    gap: 24px;
    height: 70vh;
}

/* Canvas Area */
.combo-canvas-container {
    flex: 1;
    position: relative;
}

.combo-canvas {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    border: 2px dashed rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.02);
}

.canvas-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    pointer-events: none;
    font-size: 1.2rem;
    font-weight: 600;
}

.canvas-item {
    position: absolute;
    width: 120px;
    /* Base size */
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.2s;
}

.canvas-item:active {
    cursor: grabbing;
}

.canvas-item img {
    width: 100%;
    display: block;
    pointer-events: none;
    /* Allow dragging wrapper */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Item Selection & Controls */
.canvas-item.selected img {
    filter: drop-shadow(0 0 0 2px var(--accent-color));
}

.canvas-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
}


/* --- COMBO EDITOR --- */
.combo-workspace {
    display: flex;
    gap: 16px;
    height: 100%;
    min-height: 0; /* Flexbox overflow fix */
    margin-top: 16px;
    position: relative;
}

/* Sidebar */
.combo-sidebar {
    width: 240px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-search {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.5);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.sidebar-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-content: start;
    padding-right: 4px; /* Space for scrollbar */
}

.combo-item-thumb {
    position: relative;
    aspect-ratio: 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.combo-item-thumb:active {
    cursor: grabbing;
}
.combo-item-thumb:hover {
    transform: scale(1.02);
    border-color: var(--accent-color);
}
.combo-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.combo-item-thumb .plus-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.combo-item-thumb:hover .plus-overlay {
    opacity: 1;
}

/* Canvas Container */
.combo-canvas-container {
    flex: 1;
    position: relative;
    background: #f5f5f7;
    border-radius: 16px;
    border: 2px dashed rgba(0,0,0,0.1);
    overflow: hidden;
}

.combo-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    /* Dot pattern background */
    background-image: radial-gradient(rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.canvas-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-tertiary);
    font-size: 1.2rem;
    pointer-events: none;
}

.canvas-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 1000;
}

/* Canvas Item */
.canvas-item {
    position: absolute;
    width: 120px;
    height: 120px;
    padding: 6px;
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.2s;
    user-select: none;
    border-radius: 12px; /* Ensure glass panel look */
}
.canvas-item.selected {
    box-shadow: 0 0 0 2px var(--accent-color), 0 8px 20px rgba(0,0,0,0.1);
    z-index: 1000 !important; /* Bring to very front */
}
.canvas-item:active {
    cursor: grabbing;
}
.canvas-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Item Overlay Controls (Delete/Up) */
.canvas-controls-overlay {
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.canvas-item:hover .canvas-controls-overlay,
.canvas-item.selected .canvas-controls-overlay {
    opacity: 1;
    pointer-events: auto;
}

.ctrl-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.ctrl-btn.delete { color: #ff3b30; }
.ctrl-btn:hover { transform: scale(1.1); }

/* Animation */
.anim-drop {
    animation: dropIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes dropIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .combo-workspace {
        flex-direction: column-reverse;
    }
    .combo-sidebar {
        width: 100%;
        height: 200px;
    }
    .sidebar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
/* Responsive */
@media (max-width: 900px) {
    .combo-workspace {
        flex-direction: column-reverse;
        height: auto;
    }

    .combo-sidebar {
        width: 100%;
        height: 300px;
    }

    .combo-canvas {
        height: 500px;
    }
}

.canvas-controls-overlay {
    position: absolute;
    top: -10px;
    right: -10px;
    display: none;
    /* Hidden unless selected/hovered */
    gap: 4px;
}

.canvas-item:hover .canvas-controls-overlay,
.canvas-item.selected .canvas-controls-overlay {
    display: flex;
}

.ctrl-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ctrl-btn.delete {
    background: #ff3b30;
}

.ctrl-btn.front {
    background: var(--accent-color);
}

/* Animations */
@keyframes drop-bounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

.anim-drop {
    animation: drop-bounce 0.4s var(--ease-spring) forwards;
}

.combo-workspace {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
    min-height: 500px;
    margin-top: 16px;
}

.combo-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
}

.combo-item-thumb {
    background: white;
    border-radius: 12px;
    padding: 8px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.combo-item-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.combo-item-thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 6px;
}

.combo-item-thumb .caption {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    color: var(--text-secondary);
}

.closet-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
}

.closet-item-mini {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: grab;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.closet-item-mini:hover {
    transform: scale(1.05);
}

.closet-item-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saved-combo-card {
    padding: 12px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.saved-combo-card:hover {
    background: rgba(255, 255, 255, 0.6);
}

.sidebar-search {
    width: 100%;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: var(--font-body);
}

.sidebar-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
    padding-right: 4px;
}

/* Custom Scrollbar for sidebar */
.sidebar-grid::-webkit-scrollbar {
    width: 4px;
}

.sidebar-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.ai-results-container {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.ai-insight {
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #c9a0dc;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
    animation: fadeUp 0.3s ease-out;
}

.ai-insight:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.2);
}

/* --- Misc --- */
.loading-spinner {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- Toggles --- */
.toggle-switch-label {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch-label input:checked+.toggle-slider {
    background-color: var(--accent-color);
}

.toggle-switch-label input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

.toast-notification {
    position: fixed;
    top: -100px;
    /* Start hidden above screen */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    /* Top of everything */

    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.05);

    padding: 12px 24px;
    border-radius: 100px;
    /* Pill shape */

    display: flex;
    align-items: center;
    gap: 12px;

    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);

    transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Spring-like entry */
    pointer-events: none;
    /* Don't block clicks */
}

.toast-notification.visible {
    top: 24px;
    /* Slide down to visible area */
}

.toast-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.toast-message {
    white-space: nowrap;
}

/* Dark mode / Love mode adjustments if needed */
body.mode-love .toast-notification {
    background: rgba(255, 245, 247, 0.95);
    color: #4A2C2C;
}

/* [FIX] Masonry Grid - Prevent Meshing/Overlapping */
.masonry-grid {
    column-count: 4;
    column-gap: 24px;
    width: 100%;
    padding-bottom: 100px;
}

@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        column-count: 1;
    }
}

.card,
.pin-item {
    display: inline-block;
    /* Critical for masonry */
    width: 100%;
    margin-bottom: 24px;
    break-inside: avoid;
    /* Prevents cutting in half */
    vertical-align: top;
}

/* High Priority Glow */
.card-priority-high {
    border: 1.5px solid rgba(255, 59, 48, 0.5) !important;
    box-shadow: 0 8px 25px rgba(255, 59, 48, 0.2) !important;
}

.card-priority-high:hover {
    box-shadow: 0 12px 35px rgba(255, 59, 48, 0.35) !important;
    border-color: rgba(255, 59, 48, 0.8) !important;
}

.card-closet {
    /* Warmer, homier feel for closet items */
    background: rgba(255, 250, 245, 0.7);
    /* Very subtle warm tint */
    border-color: rgba(255, 255, 255, 0.6);
}

.card-closet:hover {
    box-shadow: 0 15px 35px rgba(100, 50, 0, 0.08);
    /* Warmer shadow */
    transform: translateY(-6px) scale(1.02);
}

.card-closet .card-img-container {
    /* Slightly softer border radius */
    border-radius: 20px;
}

.card-closet .card-action-btn {
    background: rgba(255, 255, 255, 0.95);
}

/* AI Highlight (Field Flash) */
@keyframes flash-highlight {
    0% {
        background-color: rgba(255, 255, 255, 0.6);
    }

    50% {
        background-color: rgba(255, 215, 0, 0.3);
        border-color: #FFD700;
    }

    100% {
        background-color: rgba(255, 255, 255, 0.6);
    }
}

.ai-filled-highlight {
    animation: flash-highlight 1s ease-out;
}

/* AI Fade In Result */
@keyframes ai-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-fade-in {
    animation: ai-fade-up 0.4s ease-out forwards;
}

/* Loading Bar */
.ai-loading-bar {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.ai-loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    animation: shimmer-load 1s infinite linear;
}

@keyframes shimmer-load {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(300%);
    }
}

/* Append to css/components.css */

/* AI Loading & Highlight */
.ai-loading-bar {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.ai-loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    animation: shimmer-load 1s infinite linear;
}

@keyframes shimmer-load {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(300%);
    }
}

@keyframes flash-highlight {
    0% {
        background-color: rgba(255, 255, 255, 0.6);
    }

    50% {
        background-color: rgba(255, 215, 0, 0.3);
        border-color: #FFD700;
    }

    100% {
        background-color: rgba(255, 255, 255, 0.6);
    }
}

.ai-filled-highlight {
    animation: flash-highlight 1s ease-out;
}

/* Entry Animations */
@keyframes ai-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-fade-in {
    animation: ai-fade-up 0.4s ease-out forwards;
}

/* Magic Button (Already exists but ensure gradient is lively) */
.btn-magic {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Analytics & Progress */
.analytics-widget {
    padding: 16px;
    margin-bottom: 24px;
    animation: fadeSlideUp 0.3s ease-out;
}

.level-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 8px 12px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255, 165, 0, 0.3);
}

.level-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.level-progress-bar .fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    transition: width 1s ease-out;
}

.stat-mini {
    background: rgba(255, 255, 255, 0.5);
    padding: 8px;
    border-radius: 8px;
}

/* Gift Mode */
.gift-mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 12px;
    padding: 0 4px;
}

.scroll-row {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 12px;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.scroll-row::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

/* --- APP SHELL LAYOUT --- */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg-color-3);
    /* Solid bg for performance */
}

/* Sidebar (Desktop) */
.shell-sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.shell-logo img {
    height: 40px;
    margin-bottom: 40px;
}

.shell-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shell-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.shell-nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.shell-nav-item.active {
    background: var(--text-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shell-content {
    flex: 1;
    margin-left: 260px;
    /* Offset for sidebar */
    padding: 40px;
    max-width: 1400px;
}

/* Mobile Header & Bottom Bar (Hidden on Desktop) */
.shell-mobile-header,
.shell-bottom-bar {
    display: none;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 900px) {
    .shell-sidebar {
        display: none;
    }

    .shell-content {
        margin-left: 0;
        padding: 80px 20px 100px;
        /* Space for header/bottom bar */
    }

    .shell-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        z-index: 100;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .shell-bottom-bar {
        display: flex;
        justify-content: space-around;
        padding: 12px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        z-index: 100;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .bottom-nav-item {
        font-size: 1.5rem;
        padding: 8px;
        border-radius: 12px;
        color: var(--text-secondary);
        transition: transform 0.2s;
    }

    .bottom-nav-item.active {
        color: var(--accent-color);
        transform: translateY(-2px);
    }
}

/* --- Landing Page --- */
.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-color-1), var(--bg-color-2));
}

.landing-hero {
    max-width: 600px;
    margin-bottom: 60px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #333, #666);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.floating-anim {
    animation: float 6s ease-in-out infinite;
}

.landing-features {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 16px 24px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* --- Onboarding --- */
.onboarding-container {
    max-width: 450px;
    margin: 80px auto;
    padding: 40px;
    text-align: center;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

/* --- APP SHELL --- */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg-color-3);
}

.shell-sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.shell-logo img {
    height: 40px;
    margin-bottom: 40px;
}

.shell-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shell-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.shell-nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.shell-nav-item.active {
    background: var(--text-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shell-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    max-width: 1400px;
}

.shell-mobile-header,
.shell-bottom-bar {
    display: none;
}

/* Mobile */
@media (max-width: 900px) {
    .shell-sidebar {
        display: none;
    }

    .shell-content {
        margin-left: 0;
        padding: 80px 20px 100px;
    }

    .shell-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        z-index: 100;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .shell-bottom-bar {
        display: flex;
        justify-content: space-around;
        padding: 12px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        z-index: 100;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .bottom-nav-item {
        font-size: 1.5rem;
        padding: 8px;
        border-radius: 12px;
        color: var(--text-secondary);
        transition: transform 0.2s;
    }

    .bottom-nav-item.active {
        color: var(--accent-color);
        transform: translateY(-2px);
    }
}

/* --- LANDING --- */
.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-color-1), var(--bg-color-2));
}

.landing-hero {
    max-width: 600px;
    margin-bottom: 60px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #333, #666);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.floating-anim {
    animation: float 6s ease-in-out infinite;
}

.landing-features {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.landing-logo {
    width: 120px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

.feature-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 16px 24px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* --- ONBOARDING --- */
.onboarding-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-color-4);
}

.onboarding-container {
    max-width: 450px;
    width: 100%;
    padding: 40px;
    text-align: center;
    background: white;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

.onboarding-step {
    animation: fadeUp 0.4s ease-out;
}

.scroll-row {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE */
}
.scroll-row::-webkit-scrollbar { 
    display: none; 
}

/* Analytics & Planner Modal Styles */
.form-input {
    padding: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.8);
    font-size: 1rem;
}

/* Transitions */
.view-transition-fade {
    animation: fadeUp 0.3s ease-out forwards;
}
.grid-transition-fade {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* --- Onboarding Styles --- */
.step-dot { 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    background: var(--background-secondary); 
    transition: all 0.3s; 
    border: 1px solid rgba(0,0,0,0.1);
}
.step-dot.active { 
    background: var(--accent-color); 
    transform: scale(1.3); 
    border-color: var(--accent-color);
}

/* --- Home View Styles --- */
.home-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 0;
}

.financial-card {
    /* Use the glass-panel styles but make it stand out */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 5px solid var(--accent-color);
}

.home-view .subtitle {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

/* --- OCCASION PILLS (Wishlist Filter) --- */
.filter-scroll-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 4px 12px 4px;
    scrollbar-width: none; /* Firefox */
    margin-bottom: 16px;
}
.filter-scroll-container::-webkit-scrollbar { display: none; }

.occasion-pill {
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.6);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s var(--ease-ios);
}

.occasion-pill.active {
    background: var(--text-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: transparent;
}

.occasion-pill:hover:not(.active) {
    background: rgba(255,255,255,0.8);
    transform: translateY(-1px);
}

/* Modal Step Transitions */
.modal-step {
    animation: fadeUp 0.3s ease-out;
}

/* --- ADD WISH FORM FIXES --- */
.url-input-container {
    background: white;
    padding: 32px 20px;
    border-radius: 24px;
    text-align: center;
    border: 2px dashed #e0e0e0;
    transition: border-color 0.3s;
}
.url-input-container:focus-within {
    border-color: var(--accent-color);
    background: #fafaff;
}

#input-url-step1 {
    text-align: center;
    font-size: 1.1rem;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.fetched-preview {
    display: flex;
    gap: 16px;
    align-items: center;
    background: white;
    padding: 16px;
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.fetched-img {
    width: 80px; height: 80px;
    border-radius: 12px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}

/* Weekly Saving Widget */
.saving-widget {
    background: linear-gradient(135deg, #f6f8fd 0%, #f1f4f9 100%);
    border-radius: 16px;
    padding: 16px;
    margin-top: 12px;
    display: none; /* Hidden by default */
    border: 1px solid rgba(0,0,0,0.05);
}
.saving-widget.visible { display: block; animation: fadeUp 0.3s; }

.saving-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #34C759;
}