:root {
    --gold: #b28e4e;
    --gold-extra: #d4af37;
    --charcoal: #080808;
    --off-white: #fdfdfd;
    --border-light: rgba(0, 0, 0, 0.08);
    --text-dark: #121212;
    --text-muted: #8a8a8a;
    --sidebar-width: 280px;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.03);
    --shadow-editorial: 0 20px 60px rgba(0, 0, 0, 0.05), 0 5px 15px rgba(0, 0, 0, 0.02);
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --glass: rgba(255, 255, 255, 0.85);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--off-white);
    color: var(--text-dark);
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* Hide scrollbars globally but keep functionality */
* {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

*::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Premium Animated Background */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    background: linear-gradient(-45deg, #fdfdfd, #f9f9f9, #ffffff, #f7f7f7);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    /* Slower, more subtle */
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Custom Selection */
::selection {
    background: var(--gold);
    color: white;
}

/* Sidebar Styling - Glassmorphism */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    padding: 3rem 2rem;
    height: 100vh;
    z-index: 100;
}

.brand {
    margin-bottom: 3.5rem;
}

.brand h1 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    color: var(--charcoal);
    line-height: 0.9;
}

.brand span {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 6px;
    color: var(--gold);
    display: block;
    margin-top: 10px;
    opacity: 0.6;
}

nav {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    min-height: 0;
}



.nav-btn {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1rem 1.4rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-btn i {
    font-size: 0.9rem;
    width: 20px;
    opacity: 0.5;
}

.nav-btn:hover {
    color: var(--text-dark);
    transform: translateX(5px);
}

.nav-btn.active {
    background: var(--charcoal);
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 6px rgba(178, 142, 78, 0.1);
}

.nav-btn.active i {
    opacity: 1;
    color: var(--gold-extra);
}

.nav-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.05), transparent);
    margin: 2rem 1.5rem;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Main Display */
.main-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 3rem 6rem;
    /* Slightly wider padding */
    scroll-behavior: smooth;
    perspective: 2000px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
    position: sticky;
    top: 0;
    background: rgba(253, 253, 253, 0.9);
    backdrop-filter: blur(15px);
    padding: 2.5rem 0;
    z-index: 50;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    width: 320px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--gold);
    width: 400px;
}

.search-bar i {
    color: #ccc;
    margin-right: 12px;
    font-size: 0.8rem;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-dark);
}

/* Wardrobe Grid */
.wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 3.5rem;
    padding-bottom: 5rem;
}

.clothing-card {
    background: transparent;
    transition: var(--transition);
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
    position: relative;
    transform-style: preserve-3d;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

.clothing-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.image-container {
    aspect-ratio: 3/4;
    /* Standard editorial aspect ratio */
    background-color: #f5f5f5;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    box-shadow: var(--shadow-editorial);
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.98);
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.clothing-card:hover .image-container img {
    transform: scale(1.08);
    filter: brightness(1.02);
}

.item-info {
    padding: 1.5rem 0;
}

.item-info h4 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: -0.3px;
}

.category-tag {
    font-size: 0.55rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 700;
    display: inline-block;
}

.card-actions {
    position: absolute;
    top: 15px;
    /* Move to top for better visibility over editorial images */
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition);
}

.clothing-card:hover .card-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    background: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--charcoal);
    color: white;
    transform: scale(1.1);
}

.action-btn.success {
    background: var(--gold);
    color: white;
}

/* Outfit Planner Panel - Superior Glassmorphism */
.outfit-planner-panel {
    position: fixed;
    right: -520px;
    top: 0;
    width: 520px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.7);
    /* More transparent */
    backdrop-filter: blur(80px);
    /* Deep blur */
    -webkit-backdrop-filter: blur(80px);
    box-shadow: -40px 0 100px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 4rem 3.5rem;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    /* Subtle light border */
}

/* Add a subtle top-to-bottom shimmer to the panel */
.outfit-planner-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent 30%);
    pointer-events: none;
}

.outfit-planner-panel.open {
    right: 0;
}

.planner-header h2 {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -1px;
}

/* Mood-board Style Canvas - Organic Stacking */
.outfit-canvas {
    flex: 1;
    overflow-y: auto;
    position: relative;
    margin: 2.5rem 0;
    padding: 3rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    perspective: 1200px;
}

.planner-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.planner-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.canvas-item {
    position: relative;
    margin-bottom: -15px;
    /* Minimal overlap */
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    width: 280px;
    align-self: center;
}

.canvas-item-inner {
    position: relative;
    background: white;
    padding: 0.5rem;
    border: 1px solid var(--gold);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.canvas-item:hover {
    z-index: 100;
    transform: scale(1.05) translateY(-10px) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.canvas-item img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}

.item-details {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.item-details h5 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.item-details span {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold);
    font-weight: 700;
}

.remove-item-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--charcoal);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    border: 1px solid var(--gold);
    line-height: 1;
    padding-bottom: 2px;
}

.remove-item-btn:hover {
    background: var(--gold);
    transform: scale(1.1);
}

/* Buttons */
.btn-gold {
    background: var(--charcoal);
    color: white;
    border: none;
    padding: 1.3rem 2.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 5px;
}

.btn-gold:hover {
    box-shadow: 0 15px 35px rgba(178, 142, 78, 0.25);
}

.btn-gold:active,
.ai-btn:active {
    transform: none;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border-light);
    padding: 0.9rem 2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.btn-outline:hover {
    border-color: var(--charcoal);
    background: var(--charcoal);
    color: white;
    transform: translateY(-2px);
}

/* Premium Text & Close Buttons */
.btn-text {
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 1rem;
    /* Balanced padding */
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.4s ease;
}

.btn-text:hover {
    color: var(--charcoal);
}

.btn-text:hover::after {
    width: 100%;
}

.close-btn,
.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover,
.close-modal:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--charcoal);
}

.modal.ai-themed .close-modal {
    color: rgba(255, 255, 255, 0.5);
}

.modal.ai-themed .close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* My Outfits View */
.view-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: 4rem;
    letter-spacing: -1px;
}

.outfits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 4rem;
}

.outfit-set-card {
    background: white;
    padding: 3rem;
    border-radius: 4px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.outfit-set-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.07);
}

.outfit-set-images {
    display: flex;
    gap: 15px;
    margin-top: 2rem;
    overflow-x: auto;
    padding-bottom: 10px;
}

.outfit-set-images img {
    width: 90px;
    height: 120px;
    object-fit: cover;
    border-radius: 2px;
    filter: sepia(0.2);
}

/* Standard Modals & Forms */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.open {
    display: flex;
}

@keyframes modalScale {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

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

.modal-content {
    background: white;
    padding: 4rem 3.5rem;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
    animation: modalScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-header {
    margin-bottom: 2.5rem;
}

.modal-header h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 0.8rem;
}

input,
select {
    width: 100%;
    background: #fcfcfc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: var(--transition);
}

input:focus,
select:focus {
    background: white;
    border-color: var(--gold);
    box-shadow: 0 10px 20px rgba(178, 142, 78, 0.05);
    outline: none;
}

/* Premium AI Button Styling */
.sidebar-ai-section {
    margin: 2rem 0;
}

.ai-btn {
    width: 100%;
    background: linear-gradient(135deg, #b28e4e 0%, #d4af37 50%, #b28e4e 100%);
    background-size: 200% auto;
    color: var(--charcoal);
    border: none;
    padding: 1.2rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    animation: shine 3s linear infinite;
    /* Removed floatingAI */
    box-shadow: 0 10px 20px rgba(178, 142, 78, 0.2);
}

@keyframes floatingAI {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.ai-btn:hover {
    box-shadow: 0 20px 40px rgba(178, 142, 78, 0.4);
    color: white;
}

.modal.ai-themed {
    background: rgba(8, 8, 8, 0.85);
    /* Darker backdrop for AI */
}

.modal-content.ai-gradient {
    background: #0a0a0a;
    background-image:
        radial-gradient(at 0% 0%, rgba(178, 142, 78, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(212, 175, 55, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(178, 142, 78, 0.08) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(212, 175, 55, 0.12) 0px, transparent 50%);
    color: white;
    border: 1px solid rgba(178, 142, 78, 0.2);
    max-width: 750px;
    /* Slightly wider for editorial look */
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.ai-gradient::before {
    display: none;
    /* Removing old animation */
}

@keyframes rotateAI {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ai-form-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.ai-form-group input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 1.2rem;
    font-size: 1rem;
}

.btn-ai-glow {
    background: var(--gold-extra);
    color: var(--charcoal);
    border: none;
    padding: 0 2rem;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ai-glow:hover {
    box-shadow: 0 0 25px rgba(178, 142, 78, 0.5);
    transform: translateY(-2px);
}

/* AI Pulse Animation */
.ai-pulse-container {
    padding: 4rem;
    text-align: center;
}

.pulse {
    width: 80px;
    height: 80px;
    background: var(--gold-extra);
    border-radius: 50%;
    margin: 0 auto 2rem;
    animation: pulseLoop 1.5s infinite ease-in-out;
}

@keyframes pulseLoop {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(178, 142, 78, 0.7);
    }

    70% {
        transform: scale(1.1);
        opacity: 1;
        box-shadow: 0 0 0 20px rgba(178, 142, 78, 0);
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(178, 142, 78, 0);
    }
}

.ai-input-area {
    background: rgba(255, 255, 255, 0.03);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
}

.ai-input-area p {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.ai-notes {
    background: rgba(178, 142, 78, 0.05);
    padding: 2.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--gold-extra);
    margin: 2rem 0;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #f0f0f0;
    font-style: italic;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ai-recommended-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    padding: 1rem;
}

.ai-recommended-items img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(178, 142, 78, 0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.ai-recommended-items img:hover {
    transform: scale(1.05) rotate(2deg);
    border-color: var(--gold-extra);
    box-shadow: 0 25px 50px rgba(178, 142, 78, 0.2);
}

.ai-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
}

.hidden {
    display: none !important;
}

.full-width {
    width: 100%;
}

/* Custom Naming Features */
.planner-name-input {
    margin: 1.5rem 0;
}

.planner-name-input input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    font-size: 1.1rem;
    font-family: var(--font-serif);
    width: 100%;
    transition: var(--transition);
    border-radius: 0;
}

.planner-name-input input:focus {
    border-color: var(--gold);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.action-btn.small {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}