/* LEVEL3D UP Inventory Styles */

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-gold: #fbbf24;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --border: #222222;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    padding: 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-icon { font-size: 32px; }

.logo-text h1 {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.location-selector {
    margin-bottom: 16px;
}

.location-selector select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--accent-cyan); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.stat.warning .stat-value { color: var(--accent-orange); }
.stat.danger .stat-value { color: var(--accent-red); }

/* Location Summary */
.location-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
}

.location-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.location-card.has-alerts { border-color: var(--accent-orange); }

/* Category Browser */
.category-browser {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.category-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.category-card.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border-color: transparent;
}

.category-card.active .cat-icon,
.category-card.active .cat-name {
    color: #fff;
}

.cat-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.cat-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-name { font-weight: 600; margin-bottom: 8px; }

.location-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.alert-count { color: var(--accent-orange); font-weight: 600; }

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.quick-actions button {
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-secondary.active {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    border-color: #8b5cf6;
}

#notification-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.controls input, .controls select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.controls input { flex: 1; min-width: 150px; }
.controls input::placeholder { color: var(--text-muted); }

.view-toggle { display: flex; gap: 4px; }
.view-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.view-btn.active { background: var(--accent-cyan); color: white; }

/* Inventory Container */
.inventory-container {
    padding: 16px;
}

/* Category Section */
.category-section { margin-bottom: 24px; }

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
}

.category-icon { font-size: 20px; }
.category-name { font-weight: 600; }
.category-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Item Card */
.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.item-card:hover { border-color: var(--accent-cyan); }

.item-card.status-low { border-color: var(--accent-orange); }
.item-card.status-out { border-color: var(--accent-red); opacity: 0.7; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.item-icon { font-size: 28px; }

.stock-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.stock-badge.in-stock { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.stock-badge.low { background: rgba(249, 115, 22, 0.2); color: var(--accent-orange); }
.stock-badge.out { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }

.item-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }

.item-location { margin-bottom: 12px; }

.location-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
}

.stock-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.stock-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 2px;
}

.status-low .stock-fill { background: var(--accent-orange); }
.status-out .stock-fill { background: var(--accent-red); width: 100% !important; }

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 12px;
}

.item-meta span {
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-muted);
}

.price { color: var(--accent-gold) !important; font-weight: 600; }

.card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.card-actions button { flex: 1; }

.btn-quick {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-quick:hover { border-color: var(--accent-cyan); color: var(--text-primary); }

.btn-edit {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 18px; }

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

/* Form */
form { padding: 20px; }

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

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

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button { flex: 1; }

/* Qty Input Group */
.qty-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-input-group button {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

.qty-input-group input {
    width: 80px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.transfer-available {
    display: block;
    text-align: center;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    z-index: 200;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    z-index: 100;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 16px;
    font-size: 11px;
}

.nav-btn span:first-child { font-size: 20px; }
.nav-btn.active, .nav-btn:hover { color: var(--accent-cyan); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon { font-size: 64px; margin-bottom: 16px; }

.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s;
}

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

/* Badge */
.badge {
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* Delete X Button on Cards */
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-delete-x {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete-x:hover {
    background: var(--accent-red);
    color: white;
    transform: scale(1.1);
}

/* Delete Modal Styles */
.delete-modal {
    max-width: 400px;
}

.delete-michael {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-purple);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    animation: michaelPulse 1s ease-in-out infinite;
}

@keyframes michaelPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.delete-question {
    font-size: 16px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.delete-warning {
    font-size: 16px;
    color: var(--accent-red);
    text-align: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.delete-hint {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
}

.delete-hint.warning {
    color: var(--accent-orange);
}

.delete-actions {
    flex-direction: column;
    gap: 12px;
}

.delete-actions button {
    width: 100%;
    padding: 14px;
}

.btn-archive {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-archive:hover {
    opacity: 0.9;
}

.btn-delete-confirm {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-confirm:hover {
    background: var(--accent-red);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* ============================================
   BANANA DUCK MASCOT - The Legend
   ============================================ */

.nozzle-mascot {
    position: fixed;
    bottom: 80px;
    left: -80px;
    z-index: 100;
    cursor: pointer;
    animation: walkAcross 20s linear infinite;
    pointer-events: auto;
}

.nozzle-mascot:hover {
    animation-play-state: paused;
}

.mascot-body {
    position: relative;
}

.mascot-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
    animation: duckBob 0.6s ease-in-out infinite;
    transition: transform 0.2s;
}

.nozzle-mascot:hover .mascot-img {
    transform: scale(1.1);
}

/* Speech bubble */
.speech-bubble {
    position: absolute;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--bg-secondary);
    border: 2px solid #FFC107;
    border-radius: 16px;
    padding: 12px 16px;
    min-width: 180px;
    max-width: 280px;
    text-align: center;
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.speech-bubble.show {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #FFC107 transparent transparent transparent;
}

.speech-text {
    display: block;
    line-height: 1.4;
}

.speech-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--accent-red);
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.speech-bubble.show .speech-close {
    opacity: 1;
}

.speech-close:hover {
    transform: scale(1.1);
}

/* Animations */
@keyframes walkAcross {
    0% {
        left: -80px;
    }
    100% {
        left: calc(100% + 80px);
    }
}

@keyframes duckBob {
    0%, 100% {
        transform: translateY(0) rotate(-2deg);
    }
    50% {
        transform: translateY(-5px) rotate(2deg);
    }
}

/* Mobile: hide mascot on small screens */
@media (max-width: 480px) {
    .nozzle-mascot {
        display: none;
    }
}

/* Collapsible Header Styles */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.collapse-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.collapse-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

#collapse-icon {
    display: inline-block;
    transition: transform 0.3s;
}

#collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.header-content-expanded {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.header-content-collapsed {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

/* Profile Menu - Top Right */
.header-profile {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 6px 12px;
    cursor: pointer;
}

.profile-avatar {
    font-size: 20px;
}

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

.profile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}

.profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 1000;
}

.profile-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.profile-menu a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.profile-menu hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

/* Responsive */
@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .header-stats { gap: 16px; }
    .items-grid { grid-template-columns: 1fr; }
    
    .header-profile {
        top: 12px;
        right: 12px;
        padding: 4px 8px;
    }
    
    .profile-name {
        display: none;
    }
}
