:root {
    --pink: #fcd6df;
    --peach: #ffd9c0;
    --cream: #fff5f8;
    --lavender: #e0d4fc;
    --mint: #d8f3dc;
    --text-dark: #5f5473;
    --shadow: rgba(255, 182, 193, 0.55);
    --blush: #ffe6f2;
    --rose: #ff9ac8;
    --bubble: rgba(255, 255, 255, 0.92);
    --text-muted: #a386af;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Poppins", "Noto Sans SC", "Microsoft Yahei", sans-serif;
    background: linear-gradient(180deg, #fff7fb 0%, #ffeef8 45%, #ffddea 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

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

.page-shell {
    min-height: 100vh;
    padding: 2rem 1rem 5rem;
    position: relative;
    overflow: hidden;
}

.cloud {
    position: absolute;
    filter: blur(4px);
    opacity: 0.6;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 214, 227, 0.8));
    border-radius: 50%;
}

.cloud.cloud-1 {
    width: 240px;
    height: 120px;
    top: 2rem;
    left: 5%;
}

.cloud.cloud-2 {
    width: 200px;
    height: 100px;
    top: 4rem;
    right: 8%;
}

.cloud.cloud-3 {
    width: 180px;
    height: 90px;
    bottom: 8rem;
    left: 10%;
}

.content-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* Base Components & Global UI */

/* Empty States (Global) */
.empty-closet {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}

.empty-closet__card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 30px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 25px 50px rgba(255, 182, 193, 0.35);
    border: 1px solid rgba(255, 204, 224, 0.6);
    max-width: 420px;
}

.empty-title {
    margin: 0;
    font-size: 1.3rem;
    color: #ff6ea3;
}

.empty-body {
    margin: 0.6rem 0 1.5rem;
    color: var(--text-muted);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(82, 61, 82, 0.25);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 20;
}

.modal.open {
    display: flex;
}

.modal-card {
    width: min(640px, 100%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 30px 60px rgba(255, 182, 193, 0.45);
    position: relative;
}

.modal-card.full-height {
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-card.small {
    width: min(420px, 100%);
    padding: 1.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 206, 222, 0.7);
    cursor: pointer;
    font-size: 1.2rem;
}

.modal h2 {
    margin-top: 0;
    color: #ff8fb3;
    font-size: 1.4rem;
    text-align: center;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.form-field label {
    font-weight: 600;
    color: #a06fa9;
}

.form-field.inline-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.inline-field .field-label {
    font-weight: 600;
    color: #a06fa9;
}

.inline-field .field-control {
    width: 100%;
}

.inline-field .field-control>* {
    width: 100%;
}

.image-field__label {
    font-weight: 600;
    color: #a06fa9;
}

.image-upload-tile {
    position: relative;
    width: min(100%, 240px);
    height: 150px;
    border-radius: 24px;
    border: 1px dashed rgba(255, 143, 179, 0.6);
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: #ff8fb3;
    font-weight: 600;
    box-shadow: inset 0 8px 18px rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.image-upload-plus {
    font-size: 2rem;
    line-height: 1;
}

.image-upload-tile input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.form-field.full-width.inline-field {
    flex-direction: column;
    align-items: flex-start;
}

.form-field.switch-field {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.form-field input,
.form-field select,
.form-field textarea,
.kawaii-input {
    border: 1px solid rgba(255, 182, 193, 0.6);
    border-radius: 18px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 3px rgba(255, 166, 192, 0.25);
}

.switch-input {
    transform: scale(1.2);
    accent-color: #ff8fb3;
    cursor: pointer;
}

.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #a06fa9;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 999px;
    padding: 0.8rem 1.8rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn.primary {
    background: linear-gradient(130deg, #ff8fb3, #f875aa);
    color: #fff;
    box-shadow: 0 12px 25px rgba(248, 117, 170, 0.35);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #ff8fb3;
    border: 1px solid rgba(255, 143, 179, 0.4);
}

.btn.ghost {
    background: transparent;
    color: #a06fa9;
    border: 1px dashed rgba(160, 111, 169, 0.4);
}

.btn.ghost.danger {
    color: #ff4a7a;
    border-color: rgba(255, 74, 122, 0.4);
}

.btn:active {
    transform: scale(0.98);
}

.btn.small {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

/* Icon Buttons */
.icon-button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--bubble);
    box-shadow: 0 8px 20px rgba(255, 182, 193, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ff6f9f;
    cursor: pointer;
}

.icon-button.ghost {
    background: transparent;
    box-shadow: none;
}

.icon-button.ghost.danger {
    color: #ff4a7a;
}

.icon-button span {
    font-size: 1rem;
}

.icon-button.small {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

/* Messages */
/* Messages (Toast Notifications) */
.messages {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 10000;
    pointer-events: none;
    /* Let clicks pass through container */
    width: auto;
    min-width: 300px;
    align-items: center;
}

.alert {
    pointer-events: auto;
    /* Re-enable clicks on toast */
    padding: 0.8rem 1.4rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(255, 120, 150, 0.25),
        0 4px 10px rgba(255, 120, 150, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #7a5c75;
    animation: toastSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.alert:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 45px rgba(255, 120, 150, 0.35);
}

.alert span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Auto-Emoji for Alert Types */
.alert.success span::before {
    content: "✨";
    font-size: 1.1rem;
}

.alert.error span::before {
    content: "🍰";
    font-size: 1.1rem;
}

.alert.warning span::before {
    content: "☁️";
    font-size: 1.1rem;
}

.alert.info span::before {
    content: "🎀";
    font-size: 1.1rem;
}

.alert button {
    background: transparent;
    border: none;
    color: #ff9ac8;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.alert button:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alert.fading-out {
    animation: toastFadeOut 0.5s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* Badges */
.badge {
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px dashed rgba(255, 143, 179, 0.4);
}

/* Mobile Layout Fixes */
@media (max-width: 640px) {
    .modal-card.full-height {
        width: 100%;
        border-radius: 24px;
        padding: 1rem 1rem 1.4rem;
    }

    .form-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-field.inline-field,
    .form-field.image-field,
    .form-field.full-width.inline-field {
        flex-direction: row !important;
        align-items: center;
        gap: 0.8rem;
        min-height: 44px;
    }

    .inline-field .field-label,
    .image-field .field-label,
    .form-field.image-field .image-field__label {
        min-width: 80px;
        width: 80px;
        margin: 0;
        white-space: nowrap;
        font-size: 0.9rem;
    }

    .inline-field .field-control,
    .image-field .field-control {
        flex: 1;
        width: auto;
    }

    .image-upload-tile {
        width: 100% !important;
        height: 48px !important;
        border-radius: 18px;
        aspect-ratio: auto;
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
        margin: 0;
    }

    .image-upload-tile small {
        font-size: 0.9rem;
    }

    .image-upload-plus {
        font-size: 1.2rem;
    }

    .form-field.full-width:last-of-type {
        flex-direction: column !important;
        align-items: flex-start;
    }

    .form-field.switch-field {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    .form-field input,
    .form-field select {
        padding: 0.5rem 0.8rem;
        height: auto;
    }
}

/* Refined Bottom Navigation (Floating Island) */
.bottom-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem;
    box-shadow: 0 15px 40px rgba(166, 111, 174, 0.25);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    z-index: 9999;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9b8da3;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding: 0.6rem 1.4rem;
    border-radius: 100px;
    position: relative;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    background: #fff;
    color: #ff6ea3;
    box-shadow: 0 4px 15px rgba(255, 110, 163, 0.25);
}

.nav-icon {
    font-size: 1.3rem;
}

/* Mobile Highlight Fix */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Modals & Dialogs Polish */
dialog {
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 36px !important;
    box-shadow: 0 40px 80px rgba(100, 80, 100, 0.2);
    padding: 0 !important;
    overflow: visible;
}

dialog::backdrop {
    background: rgba(220, 210, 230, 0.4);
    backdrop-filter: blur(8px);
}

.modal-box {
    padding: 0.8rem 2rem 2rem;
    border-radius: 36px;
    background: #fff;
    border: 1px solid white;
}

.modal-box h3 {
    font-size: 1.5rem;
    color: #ff6ea3;
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Refined Inputs */
input[type="file"] {
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 100%;
}

input[type="file"]::file-selector-button {
    border: none;
    border-radius: 12px;
    padding: 0.6rem 1rem;
    margin-right: 1rem;
    background: #fff5f8;
    color: #ff6ea3;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 182, 193, 0.2);
    transition: all 0.2s;
    border: 1px solid rgba(255, 204, 224, 0.5);
}

input[type="file"]::file-selector-button:hover {
    background: #ffe0eb;
    transform: translateY(-1px);
}

/* --- Shared Layout & Components (Moved from wardrobe.css) --- */

.closet-mobile-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 520px;
    margin: 0 auto;
}

.wardrobe-list-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 640px;
    margin: 0 auto;
}

.wardrobe-list-hero {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 36px;
    padding: 1.8rem;
    box-shadow: 0 20px 45px rgba(255, 177, 205, 0.3);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.wardrobe-list-hero .hero-title {
    margin: 0.2rem 0;
}

.wardrobe-list-hero .hero-subtitle {
    margin: 0;
    color: #9b75a5;
}

.wardrobe-list-hero .hero-copy {
    margin: 0;
    color: var(--text-muted);
}

.wardrobe-feed {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.status-pill {
    display: inline-flex;
    min-width: 68px;
    justify-content: center;
    padding: 0.35rem 0.8rem;
    border-radius: 26px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.92);
    color: #ff6ea3;
    box-shadow: 0 10px 20px rgba(255, 182, 193, 0.35);
}

.status-pill.in-media {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
}

.status-pill.bg-pink-100 {
    background: rgba(255, 208, 226, 0.95);
    color: #ff5f95;
}

.status-pill.bg-orange-100 {
    background: rgba(255, 234, 208, 0.95);
    color: #e07d1c;
}

.status-pill.bg-amber-100 {
    background: rgba(255, 242, 210, 0.95);
    color: #c28717;
}

.status-pill.bg-violet-100 {
    background: rgba(233, 217, 255, 0.95);
    color: #814fc3;
}

.status-pill.bg-teal-100 {
    background: rgba(210, 250, 243, 0.95);
    color: #0f8a78;
}

.status-pill.bg-slate-100 {
    background: rgba(230, 234, 243, 0.95);
    color: #5d6472;
}

/* Chips & Tabs */
.closet-chip {
    background: rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: #ff6ea3;
    box-shadow: 0 10px 20px rgba(255, 182, 193, 0.25);
}

.closet-chip.ghost {
    background: transparent;
    border: 1px dashed rgba(255, 143, 179, 0.4);
    color: var(--text-muted);
    box-shadow: none;
    cursor: pointer;
}

.status-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.status-tab {
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    padding: 0.65rem 1.2rem;
    font-weight: 600;
    color: #a66fae;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    box-shadow: 0 10px 18px rgba(255, 182, 193, 0.25);
    cursor: pointer;
}

.status-tab span {
    background: rgba(255, 110, 163, 0.15);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.85rem;
}

.status-tab.active {
    background: linear-gradient(130deg, #ff9ac8, #ff7bb0);
    color: #fff;
}

.mini-button {
    border: none;
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    color: #ff6ea3;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 1px rgba(255, 143, 179, 0.4);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}