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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    color: #f0f0f5;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    color: inherit;
}

/* ===== Layout ===== */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #f0f0f5;
}

.logo svg {
    color: #a855f7;
}

.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f0f0f5;
    border-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.14);
}

.btn-ghost {
    background: transparent;
    color: #8a8a9a;
    border-color: rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
    color: #f0f0f5;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #8a8a9a;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f0f0f5;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f0f0f5, #a5a5b5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.hero p {
    color: #8a8a9a;
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Cards ===== */
.wishlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.wishlist-card {
    background: rgba(26, 26, 37, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.25s ease;
    cursor: pointer;
}

.wishlist-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.wishlist-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wishlist-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f0f0f5;
}

.wishlist-card-desc {
    color: #8a8a9a;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wishlist-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6a6a7a;
    margin-top: auto;
    padding-top: 0.5rem;
}

.wishlist-card-footer {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-general { background: rgba(255, 255, 255, 0.08); color: #b0b0c0; }
.badge-birthday { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.badge-wedding { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.badge-baby_shower { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-housewarming { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-holiday { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-graduation { background: rgba(99, 102, 241, 0.15); color: #6366f1; }

.badge-priority-low { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.badge-priority-medium { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.badge-priority-high { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

/* ===== Wishlist Detail ===== */
.wishlist-detail-header {
    text-align: center;
    padding: 2rem 0 2.5rem;
}

.wishlist-detail-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.75rem 0 0.5rem;
}

.wishlist-detail-header p {
    color: #8a8a9a;
    max-width: 500px;
    margin: 0 auto 0.75rem;
}

.wishlist-detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6a6a7a;
    font-size: 0.9rem;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item-card {
    background: rgba(26, 26, 37, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.25s ease;
}

.item-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.item-purchased {
    opacity: 0.6;
}

.item-purchased .item-name {
    text-decoration: line-through;
    color: #8a8a9a;
}

.item-card-main {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.item-image {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image-placeholder {
    color: #4a4a5a;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.item-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f0f0f5;
}

.item-description {
    color: #8a8a9a;
    font-size: 0.9rem;
    line-height: 1.4;
}

.item-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.item-store {
    color: #6a6a7a;
}

.item-price {
    color: #a855f7;
    font-weight: 600;
}

.item-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.purchased-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    margin-top: 0.3rem;
    width: fit-content;
}

.group-gift-progress {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6a6a7a;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #8a8a9a;
}

.empty-state-icon {
    color: #3a3a4a;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #f0f0f5;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.empty-state p {
    margin-bottom: 1.25rem;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: rgba(22, 22, 32, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.25s ease;
}

.modal-sm {
    max-width: 360px;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    font-size: 1.5rem;
    color: #8a8a9a;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #f0f0f5;
}

/* ===== Forms ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #b0b0c0;
}

.form-group input,
.form-group textarea,
.form-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    color: #f0f0f5;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #5a5a6a;
}

.form-group select option {
    background: #1a1a25;
    color: #f0f0f5;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #a855f7;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    color: #f0f0f5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(26, 26, 37, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    color: #f0f0f5;
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 200;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .wishlists-grid {
        grid-template-columns: 1fr;
    }

    .item-card-main {
        flex-direction: column;
    }

    .item-image {
        width: 100%;
        height: 160px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .header-inner {
        padding: 0.75rem 1rem;
    }

    .main {
        padding: 1rem;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #5a5a6a;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 3rem;
}

/* URL auto-fill status */
.fetch-status {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    min-height: 1rem;
    color: #8a8a9a;
}
.fetch-status.fetching { color: #818cf8; }
.fetch-status.ok { color: #22c55e; }
.fetch-status.fail { color: #5a5a6a; }

/* Premium / upgrade */
.upgrade-body { display: flex; flex-direction: column; gap: 1rem; }
.upgrade-lede { color: #8a8a9a; font-size: 0.95rem; line-height: 1.5; }
.upgrade-lede strong { color: #f0f0f5; }
.btn-block { display: block; text-align: center; width: 100%; }
.upgrade-divider {
    display: flex; align-items: center; gap: 0.75rem;
    color: #5a5a6a; font-size: 0.8rem;
}
.upgrade-divider::before, .upgrade-divider::after {
    content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08);
}
.premium-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
    color: #f59e0b; background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.25);
    padding: 3px 10px; border-radius: 999px; text-transform: uppercase;
}
.free-counter { font-size: 0.8rem; color: #5a5a6a; margin-left: 8px; }
.upgrade-link {
    font-size: 0.8rem; color: #818cf8; cursor: pointer; background: none;
    border: none; padding: 0; text-decoration: underline;
}
.cta-banner {
    margin-top: 2.5rem; padding: 1.25rem 1.5rem; text-align: center;
    background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2);
    border-radius: 14px;
}
.cta-banner p { color: #b8b8c4; margin-bottom: 0.75rem; font-size: 0.95rem; }

/* SEO occasion pages */
.seo-copy { max-width: 680px; margin: 0 auto; color: #b8b8c4; line-height: 1.7; }
.seo-copy h2 { color: #f0f0f5; margin: 2rem 0 1rem; font-size: 1.3rem; }
.seo-copy p { margin-bottom: 1rem; }
.seo-copy ol { margin: 0 0 2rem 1.25rem; }
.seo-copy li { margin-bottom: 0.75rem; }
.seo-copy strong { color: #f0f0f5; }
.footer-occasions { margin-top: 0.75rem; display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }
.footer-occasions a { color: #5a5a6a; font-size: 0.8rem; }
.footer-occasions a:hover { color: #818cf8; }
