/* Cat Snack Bar - Cute & Cozy Theme */

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

:root {
    /* Warm, cozy colors */
    --bg-lightest: #fff8f0;
    --bg-light: #fff0e0;
    --bg-cream: #ffe8d0;
    --bg-panel: #fff5eb;
    --bg-card: #ffffff;
    --bg-hover: #fff0e5;

    /* Text colors */
    --text-primary: #4a3728;
    --text-secondary: #8b7355;
    --text-muted: #b8a090;

    /* Accent colors */
    --accent-orange: #ff8c42;
    --accent-orange-light: #ffaa66;
    --accent-orange-dark: #e67530;
    --accent-pink: #ff6b9d;
    --accent-green: #5cb85c;
    --accent-yellow: #ffc107;
    --accent-blue: #5bc0de;
    --accent-red: #d9534f;

    /* Special colors */
    --money-gold: #ffd700;
    --tip-green: #85bb65;
    --gem-blue: #4fc3f7;

    /* Borders and shadows */
    --border-color: #e8d5c4;
    --border-dark: #d4c0ad;
    --shadow-soft: 0 2px 10px rgba(74, 55, 40, 0.1);
    --shadow-medium: 0 4px 20px rgba(74, 55, 40, 0.15);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', 'Comic Sans MS', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
}

/* ============================================
   GAME CONTAINER
   ============================================ */

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #87ceeb 0%, #98d8c8 50%, #90ee90 100%);
}

/* ============================================
   RESTAURANT CANVAS
   ============================================ */

#restaurant-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================
   TOP HUD - Money Display
   ============================================ */

#top-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.98) 0%, rgba(255, 248, 240, 0) 100%);
    padding: 10px 15px 30px;
    pointer-events: none;
}

#hud-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    pointer-events: auto;
}

.hud-resource {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    font-size: 1rem;
    font-weight: bold;
}

.hud-resource.money {
    border-color: var(--money-gold);
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
}

.hud-resource.tips {
    border-color: var(--tip-green);
    background: linear-gradient(135deg, #f0fff0 0%, #e6ffe6 100%);
}

.hud-resource.gems {
    border-color: var(--gem-blue);
    background: linear-gradient(135deg, #f0f9ff 0%, #e6f5ff 100%);
}

.hud-icon {
    font-size: 1.2rem;
}

.hud-value {
    font-weight: bold;
    min-width: 50px;
    color: var(--text-primary);
}

.hud-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

#hud-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    pointer-events: auto;
}

#branch-display {
    color: var(--accent-orange);
    font-weight: bold;
}

#chapter-display {
    color: var(--accent-pink);
}

/* ============================================
   CUSTOMER QUEUE DISPLAY
   ============================================ */

#customer-queue-display {
    position: fixed;
    top: 80px;
    right: 10px;
    z-index: 90;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    padding: 8px;
    min-width: 100px;
    max-width: 180px;
    transition: all 0.3s ease;
}

/* Collapsed state - compact header only */
#customer-queue-display.collapsed {
    padding: 6px 10px;
}

#customer-queue-display.collapsed #customer-queue {
    display: none;
}

#customer-queue-display.collapsed #queue-header {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
}

#customer-queue-display.collapsed #queue-toggle {
    transform: rotate(-90deg);
}

#queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

#queue-header:hover {
    opacity: 0.8;
}

#queue-toggle {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

#queue-count {
    color: var(--accent-orange);
    font-size: 0.75rem;
}

#customer-queue {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.customer-in-queue {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: var(--bg-cream);
    border-radius: 8px;
    font-size: 0.75rem;
}

.customer-icon {
    font-size: 1rem;
}

.customer-order {
    font-size: 0.9rem;
}

.customer-patience {
    margin-left: auto;
    width: 25px;
    height: 5px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.customer-patience-fill {
    height: 100%;
    background: var(--accent-green);
    transition: width 0.3s, background-color 0.3s;
}

.customer-patience-fill.warning {
    background: var(--accent-yellow);
}

.customer-patience-fill.critical {
    background: var(--accent-red);
}

/* ============================================
   SAVE INDICATOR
   ============================================ */

#save-indicator {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
}

#save-indicator.visible {
    opacity: 1;
}

/* ============================================
   BOTTOM HUD
   ============================================ */

#bottom-hud {
    position: fixed;
    bottom: min(33.33%, 280px);
    left: 0;
    right: 0;
    z-index: 300;
    padding: 20px 15px 15px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    pointer-events: none;
    transition: bottom 0.3s ease;
}

body:has(#bottom-panel.collapsed) #bottom-hud {
    bottom: 60px;
}

#collect-tips-btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--tip-green) 0%, #6bc96b 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(133, 187, 101, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

#collect-tips-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(133, 187, 101, 0.5);
}

#collect-tips-btn:active {
    transform: translateY(0);
}

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

#hud-buttons {
    pointer-events: auto;
    display: flex;
    gap: 8px;
}

.hud-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.hud-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
}

/* ============================================
   BOTTOM PANEL
   ============================================ */

#bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: min(33.33%, 280px);
    z-index: 200;
    background: var(--bg-panel);
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    border-top: 3px solid var(--border-color);
    box-shadow: 0 -5px 30px rgba(74, 55, 40, 0.15);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, height 0.3s ease, border-radius 0.3s ease;
}

#bottom-panel.collapsed {
    transform: translateY(calc(100% - 50px));
}

#bottom-panel.expanded {
    height: calc(100% - 100px);
    height: calc(100dvh - 100px); /* Modern mobile viewport */
    max-height: none;
    border-radius: 0;
    z-index: 300;
}

#bottom-panel.expanded #panel-content {
    overflow-y: auto;
}

body:has(#bottom-panel.expanded) #bottom-hud {
    bottom: calc(100% - 100px);
}

#panel-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
}

#panel-handle:hover {
    color: var(--text-primary);
}

/* ============================================
   PANEL TABS
   ============================================ */

#panel-tabs {
    display: flex;
    gap: 0;
    padding: 0 10px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

#panel-tabs::-webkit-scrollbar {
    display: none;
}

.panel-tab {
    flex: 1;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.panel-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.panel-tab.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

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

.tab-label {
    font-size: 0.7rem;
    font-weight: 600;
}

/* ============================================
   PANEL CONTENT
   ============================================ */

#panel-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.panel-section {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 15px;
}

.panel-section.active {
    display: flex;
}

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

.section-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.scrollable-content h4 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 15px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================
   CARDS - Workstations, Menu Items, etc.
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: 15px;
    border: 2px solid var(--border-color);
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--accent-orange-light);
    box-shadow: var(--shadow-soft);
}

.card-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.card-info {
    flex: 1;
}

.card-name {
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-primary);
}

.card-level {
    font-size: 0.8rem;
    color: var(--accent-orange);
    margin-left: 8px;
}

/* Workstation Tier Badge */
.tier-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    margin-left: 6px;
    text-transform: uppercase;
}

.tier-progress {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Workstation Requirement on Menu Items */
.ws-requirement {
    font-size: 0.75rem;
    margin-left: 6px;
}

.ws-requirement.unavailable {
    opacity: 0.5;
}

.ws-warning {
    font-size: 0.7rem;
    color: var(--accent-red);
    margin-top: 2px;
}

.card.ws-missing {
    opacity: 0.7;
    border-color: var(--accent-red);
}

/* Workstation Group with Nested Menu Items */
.workstation-group {
    margin-bottom: 12px;
}

.nested-menu-items {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 2px solid var(--border-color);
}

.nested-menu-item {
    margin: 8px 0;
    padding: 10px !important;
    background: var(--bg-darker) !important;
    border-radius: 10px !important;
}

.nested-menu-item .card-icon {
    font-size: 1.2rem !important;
    min-width: 30px !important;
}

/* Location Upgrade Card in Progress Tab */
.location-upgrade-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px solid var(--accent-green);
    padding: 12px;
    margin-top: 10px;
}

.location-upgrade-card .upgrade-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.location-upgrade-card .upgrade-icon {
    font-size: 2rem;
}

.location-upgrade-card .upgrade-name {
    font-weight: bold;
    font-size: 1rem;
}

.location-upgrade-card .upgrade-benefits {
    color: var(--accent-green);
    font-size: 0.85rem;
}

.location-upgrade-card .upgrade-cost-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.location-upgrade-card .cost-breakdown {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.location-upgrade-card .trade-in {
    color: var(--accent-green);
}

.location-upgrade-card .net-cost {
    font-weight: bold;
}

.location-upgrade-card.maxed {
    border-color: var(--accent-orange);
    text-align: center;
}

/* Shop Location Card - Compact version */
.shop-location-card.compact {
    padding: 10px;
}

.shop-location-card.compact .location-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.upgrade-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

.max-tier-badge {
    font-size: 0.8rem;
    color: var(--accent-orange);
    margin-left: auto;
}

.shop-btn.upgrade-available {
    background: var(--accent-green);
    color: white;
    animation: pulse 2s infinite;
    margin-left: auto;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.card-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-stats span {
    margin-right: 10px;
}

.card-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

/* ============================================
   BUTTONS
   ============================================ */

.action-btn {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange-dark) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.4);
}

.action-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.action-btn.secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.action-btn.danger {
    background: linear-gradient(135deg, var(--accent-red) 0%, #c0392b 100%);
}

.action-btn.prestige-btn {
    background: linear-gradient(135deg, var(--accent-pink) 0%, #e74c8a 100%);
    font-size: 1.1rem;
    padding: 15px 30px;
    width: 100%;
    margin-top: 10px;
}

.upgrade-btn {
    background: linear-gradient(135deg, var(--accent-green) 0%, #4a9c4a 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.upgrade-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.upgrade-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.activate-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.activate-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.activate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.remove-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar.large {
    height: 20px;
    border-radius: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-orange) 0%, var(--accent-orange-light) 100%);
    border-radius: inherit;
    transition: width 0.3s ease;
}

/* ============================================
   STAFF SECTION
   ============================================ */

#staff-overview {
    background: var(--bg-card);
    border-radius: 15px;
    border: 2px solid var(--border-color);
    padding: 15px;
    margin-bottom: 15px;
}

.staff-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1rem;
}

#hire-worker-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ============================================
   PRESTIGE SECTION
   ============================================ */

#prestige-section {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe6ee 100%);
    border-radius: 15px;
    border: 2px solid var(--accent-pink);
    padding: 20px;
    margin: 15px 0;
    text-align: center;
}

#prestige-preview {
    margin: 15px 0;
    font-size: 0.95rem;
}

#prestige-preview p {
    margin: 5px 0;
}

/* ============================================
   SETTINGS
   ============================================ */

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.setting-row input[type="range"] {
    flex: 1;
    max-width: 150px;
}

.settings-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.settings-buttons .action-btn {
    flex: 1;
    min-width: 100px;
}

#last-save {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================
   FLOATING TIPS
   ============================================ */

#floating-tips {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

.floating-tip {
    position: absolute;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--tip-green);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: floatUp 1.5s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1.2);
    }
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

#notifications {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.notification {
    background: var(--bg-card);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    box-shadow: var(--shadow-medium);
    animation: slideIn 0.3s ease-out;
    font-size: 0.95rem;
}

.notification.success {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #f0fff0 0%, #e6ffe6 100%);
}

.notification.warning {
    border-color: var(--accent-yellow);
    background: linear-gradient(135deg, #fffbf0 0%, #fff5e0 100%);
}

.notification.error {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, #fff0f0 0%, #ffe6e6 100%);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   COOKING PROGRESS INDICATOR
   ============================================ */

.cooking-indicator {
    position: relative;
    width: 40px;
    height: 40px;
}

.cooking-progress-ring {
    transform: rotate(-90deg);
}

.cooking-progress-ring circle {
    fill: none;
    stroke-width: 4;
}

.cooking-progress-ring .bg {
    stroke: #eee;
}

.cooking-progress-ring .progress {
    stroke: var(--accent-orange);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 600px) {
    .hud-resource {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .tab-label {
        display: none;
    }

    .panel-tab {
        min-width: 50px;
        padding: 8px;
    }

    .card {
        padding: 10px;
        gap: 8px;
    }

    .card-icon {
        font-size: 1.5rem;
        min-width: 40px;
    }
}

/* ============================================
   WORKSTATION STATES
   ============================================ */

.card.cooking {
    border-color: var(--accent-orange);
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e6 100%);
}

.card.ready {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #f0fff0 0%, #e8ffe8 100%);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(92, 184, 92, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(92, 184, 92, 0);
    }
}

.card.locked {
    opacity: 0.5;
    filter: grayscale(0.5);
}

/* ============================================
   WORKER CAT INDICATOR
   ============================================ */

.worker-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.worker-indicator .cat-icon {
    font-size: 1rem;
}

/* ============================================
   SUITCASE / GACHA STYLES
   ============================================ */

.suitcase-card {
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8d0 100%);
}

.gacha-btn {
    background: linear-gradient(135deg, var(--gem-blue) 0%, #2196f3 100%) !important;
    min-width: 120px;
}

.gacha-btn:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.4);
}

/* ============================================
   COSTUME PIECE STYLES
   ============================================ */

.costume-slot-section {
    margin: 10px 0 5px;
    padding: 5px 0;
    color: var(--text-secondary);
}

.costume-piece-card {
    border-width: 3px !important;
}

.rarity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    color: white;
    margin-left: 5px;
    font-weight: bold;
}

.merge-btn {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%) !important;
    margin-top: 5px;
}

.merge-btn:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4);
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

/* ============================================
   DAILY REWARD STYLES
   ============================================ */

.daily-reward-card {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border: 2px solid #ffc107;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.daily-reward-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
}

#login-streak {
    color: var(--accent-orange);
    font-size: 1.1rem;
}

/* ============================================
   DECORATION STYLES
   ============================================ */

.card.owned {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: var(--accent-green);
}

.owned-badge {
    color: var(--accent-green);
    font-weight: bold;
    font-size: 0.9rem;
}

/* ============================================
   ACHIEVEMENT NOTIFICATION STYLES
   ============================================ */

.notification.achievement {
    border-color: #ffd700;
    background: linear-gradient(135deg, #fffde7 0%, #fff9c4 100%);
}

/* ============================================
   PARTICLE EFFECTS
   ============================================ */

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
}

.sparkle {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none;
    animation: sparkle 0.6s ease-out forwards;
}

/* ============================================
   PANEL TAB ADJUSTMENTS FOR MORE TABS
   ============================================ */

@media (max-width: 600px) {
    .panel-tab {
        min-width: 45px;
        padding: 6px 4px;
    }

    .tab-icon {
        font-size: 1.1rem;
    }
}

/* ============================================
   ENHANCED ANIMATION EFFECTS
   ============================================ */

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.card:hover .card-icon {
    animation: bounce 0.5s ease;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 140, 66, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 140, 66, 0.6); }
}

.card.ready {
    animation: pulse 1s infinite, glow 2s infinite;
}

/* Steam/smoke animation for workstations */
@keyframes steam {
    0% { opacity: 0.8; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-20px) scale(1.5); }
}

.steam-particle {
    position: absolute;
    font-size: 0.8rem;
    pointer-events: none;
    animation: steam 1.5s ease-out infinite;
}

/* ============================================
   2X BOOST BUTTON STYLES
   ============================================ */

#boost-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border: 2px solid #e65100;
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

#boost-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

#boost-btn.boost-active {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    border-color: #2e7d32;
    animation: pulse-boost 1s infinite;
}

@keyframes pulse-boost {
    0%, 100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.8); }
}

/* ============================================
   EQUIPPED OUTFIT STYLES
   ============================================ */

.equipped-outfit-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.equipped-slot {
    background: var(--bg-secondary);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.equipped-slot.filled {
    background: linear-gradient(135deg, #fff8f0 0%, #fff 100%);
}

.equipped-slot.empty {
    opacity: 0.6;
}

.slot-icon {
    font-size: 1.8rem;
}

.slot-name {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-primary);
}

.slot-rarity {
    font-size: 0.65rem;
    font-weight: bold;
}

.slot-effect {
    font-size: 0.65rem;
    color: var(--accent-green);
}

.slot-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
}

.total-bonuses {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 5px 0 10px;
}

/* ============================================
   SHOP UI STYLES
   ============================================ */

.shop-location-card {
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-light) 100%);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
}

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

.location-icon {
    font-size: 2.5rem;
}

.location-details {
    flex: 1;
}

.location-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
}

.location-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.location-capacity {
    display: flex;
    gap: 20px;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 10px;
}

.capacity-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.capacity-icon {
    font-size: 1rem;
}

/* Shop Workstation List */
.shop-ws-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.shop-ws-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.shop-ws-card.installed {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
}

.shop-ws-card.not-built {
    opacity: 0.6;
    background: var(--bg-light);
}

.shop-ws-card.locked {
    opacity: 0.5;
    background: #f5f5f5;
}

.ws-icon {
    font-size: 1.5rem;
}

.ws-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ws-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.ws-level {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ws-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* Shop Buttons */
.shop-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-btn.install {
    background: var(--accent-green);
    color: white;
}

.shop-btn.install:hover {
    background: #4cae4c;
}

.shop-btn.uninstall {
    background: var(--accent-orange);
    color: white;
}

.shop-btn.uninstall:hover {
    background: var(--accent-orange-dark);
}

.shop-btn.activate {
    background: var(--accent-blue);
    color: white;
}

.shop-btn.activate:hover {
    background: #46b8da;
}

.shop-btn.activate:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.shop-btn.deactivate {
    background: var(--text-muted);
    color: white;
}

.shop-btn.deactivate:hover {
    background: #a09080;
}

/* Shop Workstation Groups */
.shop-ws-group {
    margin-bottom: 15px;
}

.ws-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-cream);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.shop-menu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-light);
    padding: 8px;
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--border-color);
    border-top: none;
}

.shop-menu-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 8px 12px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.shop-menu-card.active {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
}

.shop-menu-card.locked {
    opacity: 0.5;
    background: #f5f5f5;
}

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

.menu-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.menu-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.menu-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.menu-unlock {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.shop-empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
}

/* Slot Info Bar */
.slot-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-light) 100%);
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.slot-location {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.slot-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 12px;
}

/* Installed/Active Badges */
.installed-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--accent-green);
    color: white;
    font-weight: bold;
    margin-left: 6px;
}

.not-installed-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--text-muted);
    color: white;
    font-weight: bold;
    margin-left: 6px;
}

.active-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--accent-blue);
    color: white;
    font-weight: bold;
    margin-left: 6px;
}

.card.ws-installed {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #e8f5e9 0%, var(--bg-card) 100%);
}

.card.menu-active {
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, #e3f2fd 0%, var(--bg-card) 100%);
}

/* Location Upgrade Section */
.location-value {
    font-size: 0.8rem;
    color: var(--accent-green);
    font-weight: 600;
    padding: 4px 8px;
    background: #e8f5e9;
    border-radius: 6px;
}

.location-upgrade {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.location-upgrade.maxed {
    text-align: center;
    padding: 12px;
}

.max-badge {
    font-size: 1rem;
    color: var(--accent-orange);
}

.upgrade-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.upgrade-icon {
    font-size: 1.8rem;
}

.upgrade-details {
    flex: 1;
}

.upgrade-name {
    font-weight: 600;
    color: var(--text-primary);
}

.upgrade-benefits {
    font-size: 0.8rem;
    color: var(--accent-green);
}

.upgrade-cost {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 10px;
}

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.cost-breakdown .trade-in {
    color: var(--accent-green);
}

.cost-breakdown .net-cost {
    font-weight: 600;
    color: var(--text-primary);
}

.shop-btn.upgrade-location {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-btn.upgrade-location:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.shop-btn.upgrade-location:disabled,
.shop-btn.upgrade-location.disabled {
    background: #ccc;
    cursor: not-allowed;
    font-size: 0.75rem;
}

/* Workstation Actions */
.ws-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ws-sell-value {
    font-size: 0.7rem;
    color: var(--accent-green);
}

.shop-btn.sell {
    background: #ff7043;
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
}

.shop-btn.sell:hover {
    background: #f4511e;
}

/* ============================================
   BRANCH SWITCHER
   ============================================ */

#branch-switcher {
    position: fixed;
    top: 380px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: calc(100% - 20px);
    max-width: 400px;
    transition: all 0.3s ease;
}

/* Minimized state - house icon at top left */
#branch-switcher.minimized {
    top: 10px;
    left: 10px;
    bottom: auto;
    transform: none;
    width: auto;
    max-width: none;
}

.branch-switcher-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-card) 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.branch-switcher-icon-btn:hover {
    transform: scale(1.05);
    border-color: var(--accent-orange);
}

.branch-switcher-icon-btn .location-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent-orange);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.branch-switcher-container {
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-card) 100%);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 2px solid var(--border-color);
}

.branch-switcher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.branch-switcher-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.branch-switcher-minimize {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--bg-cream);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.branch-switcher-minimize:hover {
    background: var(--accent-orange);
    color: white;
}

.branch-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.branch-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
    position: relative;
}

.branch-tab:hover:not(:disabled) {
    border-color: var(--accent-orange);
    transform: translateY(-2px);
}

.branch-tab.active {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #e8f5e9 0%, var(--bg-card) 100%);
    cursor: default;
}

.branch-tab-icon {
    font-size: 1.5rem;
}

.branch-tab-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.branch-tab-tier {
    font-size: 0.9rem;
}

.manager-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.8rem;
    background: var(--accent-green);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-manager-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.8rem;
    background: var(--accent-orange);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   MANAGER & NEW BRANCH SECTIONS
   ============================================ */

.manager-hire-section {
    background: linear-gradient(135deg, #fff8e1 0%, var(--bg-card) 100%);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.manager-hire-section.has-manager {
    background: linear-gradient(135deg, #e8f5e9 0%, var(--bg-card) 100%);
    border-color: var(--accent-green);
}

.manager-hire-section h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.manager-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.shop-btn.hire-manager {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
}

.shop-btn.hire-manager:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.new-branch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-branch-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
}

.new-branch-card .branch-icon {
    font-size: 1.8rem;
}

.new-branch-card .branch-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.new-branch-card .branch-name {
    font-weight: 600;
    color: var(--text-primary);
}

.new-branch-card .branch-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.shop-btn.buy-branch {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
}

.shop-btn.buy-branch:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.all-branches-owned {
    text-align: center;
    padding: 20px;
    color: var(--accent-orange);
    font-weight: 600;
}

/* Chapter sections for branch purchasing */
.chapters-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chapter-section {
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.chapter-section.locked {
    opacity: 0.7;
    border-color: #999;
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.chapter-section.locked .chapter-header {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
}

.chapter-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.lock-icon, .unlock-icon {
    font-size: 1.2rem;
}

.chapter-unlock-hint {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    background: #f5f5f5;
}

.chapter-branches {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.chapter-branches .new-branch-card {
    border: 1px solid #e0e0e0;
}

.chapter-branches .branch-desc {
    font-size: 0.7rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
