/* SuperMart Tycoon - Professional Styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary-color: #1976D2;
    --accent-color: #FFC107;
    --danger-color: #EF5350;
    --text-dark: #263238;
    --text-light: #78909C;
    --bg-light: #ECEFF1;
    --bg-paper: #FFFFFF;
    --border-color: #CFD8DC;
    --success-color: #66BB6A;
    --warning-color: #FFA726;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.12);
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
}

body {
    overflow: hidden;
}

.game-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
}

/* Header/Top Bar */
.top-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.store-level {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.stats-bar {
    display: flex;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 13px;
}

.stat-label {
    opacity: 0.9;
}

.stat-value {
    font-weight: bold;
    font-size: 14px;
}

.control-buttons {
    display: flex;
    gap: 8px;
}

.btn-control {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--text-dark);
}

.btn-primary:hover {
    background: #FFB300;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: #2e7d32;
    color: white;
}

.btn-success:hover {
    background: #1b5e20;
}

.btn-danger {
    background: #c62828;
    color: white;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #B71C1C;
}

.btn-disabled {
    background: var(--border-color);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-action {
    padding: 10px 16px;
    margin: 8px 0;
    width: 100%;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    width: auto;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-paper);
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.store-view-container {
    flex: 1;
    position: relative;
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
    overflow: auto;
}

.selection-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 2px solid white;
    backdrop-filter: blur(4px);
}

.btn-action-round {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--secondary-color);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-action-round:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}

.btn-action-round:active {
    transform: scale(0.9);
}

.btn-action-round.btn-danger {
    background: var(--danger-color);
}

#storeCanvas {
    display: block;
    margin: 0 auto;
    cursor: grab;
}

#storeCanvas:active {
    cursor: grabbing;
}

.legend {
    padding: 12px 20px;
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg-light);
}

.right-panel {
    width: 380px;
    background: var(--bg-paper);
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Tabs */
.tabs-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-light);
    padding: 0 10px;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab-btn {
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    opacity: 0.8;
}

.tab-btn:hover {
    color: var(--primary-color);
    opacity: 1;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    opacity: 1;
    background: rgba(46, 125, 50, 0.05);
}

.tab-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: none;
}

.tab-content.active {
    display: block;
}

/* Sub-tabs styles */
.sub-tab-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.sub-tab-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-paper);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-light);
}

.sub-tab-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.sub-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-content h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 16px;
}

.tab-content h4 {
    margin: 12px 0 10px 0;
    font-size: 13px;
    color: var(--text-dark);
}

/* Overview Section */
.overview-section {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.daily-challenges-panel {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.daily-challenges-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.daily-challenge-row {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 10px;
}

.achievements-panel {
    margin-top: 12px;
}

.achievements-summary {
    color: #666;
    font-size: 13px;
    margin: 6px 0 10px;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-row {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    padding: 10px 12px;
}

.achievement-row.locked {
    opacity: 0.92;
}

.achievement-row.unlocked {
    border-color: rgba(76, 175, 80, 0.45);
}

.achievement-title {
    font-weight: 800;
    color: #263238;
}

.achievement-desc {
    color: #546e7a;
    font-size: 12.5px;
    margin-top: 2px;
}

.achievement-meta {
    display: flex;
    justify-content: space-between;
    color: #607d8b;
    font-size: 12px;
    margin-top: 6px;
}

.daily-challenge-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-dark);
}

.daily-challenge-meta {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-light);
}

.daily-challenge-reward {
    color: var(--primary-color);
    font-weight: 700;
}

.overview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.overview-item:last-child {
    border-bottom: none;
}

.overview-item .value {
    font-weight: bold;
    color: var(--primary-color);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin-left: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    transition: width 0.3s;
}

/* Staff Tab */
.quick-hire-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.btn-quick-hire {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: white;
    border: 1px solid #2e7d32;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    color: #2e7d32;
    transition: all 0.2s;
}

.btn-quick-hire:hover {
    background: #2e7d32;
    color: white;
}

.staff-list {
    max-height: 400px;
    overflow-y: auto;
}

.staff-card {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.2s;
}

.staff-card.manager-card {
    border: 2px solid #fb8c00;
    background: #fff3e0;
}

.manager-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #fb8c00;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(251, 140, 0, 0.3);
}

.staff-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.staff-icon {
    font-size: 24px;
}

.staff-info h4 {
    margin: 0;
    font-size: 13px;
}

.staff-info small {
    color: var(--text-light);
    font-size: 11px;
}

.staff-stats {
    font-size: 12px;
    margin-bottom: 10px;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: var(--text-light);
}

.staff-rating {
    font-size: 12px;
    color: var(--warning-color);
    margin-bottom: 8px;
}

/* Inventory Tab */
.inventory-section {
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 12px;
}

.inventory-list {
    flex: 1;
    overflow-y: auto;
}

.inventory-category h4 {
    margin-top: 12px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.inventory-item {
    background: var(--bg-light);
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    border-left: 3px solid var(--success-color);
}

.inventory-item.aging {
    border-left-color: var(--warning-color);
}

.inventory-item.spoiling {
    border-left-color: var(--danger-color);
}

.item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.item-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 11px;
    color: var(--text-light);
}

/* Finance Tab */
.finances-section {
    font-size: 13px;
}

.finance-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid var(--secondary-color);
}

.finance-item .value {
    font-weight: bold;
    color: var(--primary-color);
}

.bills-list {
    max-height: 200px;
    overflow-y: auto;
}

.bill-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 12px;
}

.bill-amount {
    font-weight: bold;
    color: var(--danger-color);
}

/* Upgrades Tab */
.upgrades-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.upgrade-card {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.production-upgrade {
    border-left: 5px solid #4caf50 !important;
}

.layout-upgrade {
    border-left: 5px solid #2196f3 !important;
}

.upgrade-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.1);
}

.upgrade-card.owned {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--success-color);
}

.upgrade-card h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: var(--primary-color);
}

.upgrade-card p {
    font-size: 12px;
    color: var(--text-light);
    margin: 4px 0;
}

.upgrade-cost {
    color: var(--danger-color);
    font-weight: bold;
}

/* Shelf Upgrade UI */
.upgrade-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.upgrade-icon {
    font-size: 24px;
    background: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upgrade-title h4 {
    margin: 0;
    font-size: 14px;
}

.upgrade-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.level-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.old-val { color: #888; text-decoration: line-through; }
.new-val { color: var(--success-color); font-weight: bold; }
.arrow { color: #666; }

.btn-upgrade {
    width: 100%;
    padding: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-upgrade:hover {
    background: var(--primary-dark);
}

.btn-upgrade.disabled, .btn-upgrade:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-upgrade.insufficient-funds {
    background: #e0e0e0 !important;
    color: #999 !important;
    cursor: not-allowed !important;
}

.bonus-tag {
    animation: flash 2s infinite;
}

@keyframes flash {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Events Tab */
.events-panel {
    max-height: 400px;
    overflow-y: auto;
}

.event-item {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-color);
    font-size: 12px;
}

/* Pricing Tab Styling */
.pricing-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.pricing-category-header {
    grid-column: 1 / -1;
}

.pricing-item-card {
    background: var(--bg-light);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pricing-item-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

.pricing-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pricing-icon {
    font-size: 20px;
    background: white;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pricing-info h4 {
    margin: 0;
    font-size: 14px;
    text-transform: capitalize;
}

.pricing-info small {
    color: var(--text-light);
}

.pricing-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-controls input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: right;
}

/* News Panel */
.news-panel {
    max-height: 150px;
    overflow-y: auto;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 10px;
}

.news-item {
    padding: 8px;
    margin-bottom: 6px;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    border-left: 2px solid var(--secondary-color);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-paper);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    max-height: 90vh;
    max-width: 90vw;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, -40%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.modal-content {
    padding: 30px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-dark);
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Hire Staff Modal */
.hire-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.staff-option {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.staff-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.1);
}

.staff-option h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--primary-color);
}

.staff-option p {
    margin: 6px 0;
    font-size: 12px;
    color: var(--text-light);
}

.cost,
.salary {
    font-weight: bold;
    color: var(--accent-color);
}

/* Shop Items */
.inventory-shop {
    max-height: 60vh;
    overflow-y: auto;
}

.category-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.shop-item {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.shop-item .item-name {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 6px;
}

.shop-item .item-price {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 8px;
}

.item-controls {
    display: flex;
    gap: 6px;
}

.qty-input {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

/* Event Modal */
.event-modal .modal-content {
    max-width: 500px;
}

.event-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.event-choices button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* Empty State */
.empty-message {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 12px;
}

/* Store Info Tooltip */
.store-info-tooltip {
    position: absolute;
    background: var(--bg-paper);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 11px;
    z-index: 10;
    max-width: 200px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .main-content {
        gap: 15px;
    }

    .right-panel {
        width: 320px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }

    .left-panel {
        flex: 0.6;
    }

    .right-panel {
        width: 100%;
        flex: 0.4;
    }

    .stats-bar {
        font-size: 12px;
        gap: 12px;
    }

    .stat-item {
        padding: 6px 10px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 12px;
    }

    .logo {
        font-size: 18px;
    }

    .stats-bar {
        flex-wrap: wrap;
    }

    .modal {
        max-width: 95vw;
        max-height: 95vh;
    }

    .hire-options {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideInLeft 0.3s ease-out;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

.rounded {
    border-radius: 8px;
}

.shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .game-wrapper {
        background: white;
    }

    .top-bar {
        background: #333;
    }
}

/* Level Progression UI */
.goal-highlight {
    color: #ff9800;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 152, 0, 0.4);
}

.upgrade-card.locked-level {
    border: 2px dashed #666;
    background: #2a2a2a;
    position: relative;
    overflow: hidden;
}

.upgrade-card.locked-level::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    opacity: 0.1;
    pointer-events: none;
}

.btn-upgrade.insufficient-funds {
    background: #444 !important;
    color: #888 !important;
    cursor: not-allowed;
    border: 1px solid #666;
}

.btn-upgrade.insufficient-funds:hover {
    transform: none;
    box-shadow: none;
}

/* Level Up Celebration Animations */
@keyframes celebrate {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) translateY(-100px);
        opacity: 0;
    }
}

.level-celebration {
    animation: celebrate 2s ease-out;
}

/* Floating Feedback Text */
.feedback-floater {
    position: absolute;
    font-weight: bold;
    font-size: 18px;
    pointer-events: none;
    animation: float-up 1.5s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(0.8);
        opacity: 0;
    }
}

/* Smooth transitions for interactive elements */
.upgrade-card, .btn-action, .modal-content {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.upgrade-card:hover {
    transform: translateY(-2px);
}

/* Progress bar animations */
@keyframes progress-fill {
    from {
        width: 0;
    }
    to {
        width: var(--progress-width);
    }
}

.progress-bar-fill {
    animation: progress-fill 0.5s ease-out;
}

/* Customer mood indicators */
.customer-happy {
    filter: brightness(1.2) saturate(1.3);
}

.customer-annoyed {
    filter: hue-rotate(45deg) saturate(0.7);
}

.customer-angry {
    filter: hue-rotate(0deg) saturate(2) brightness(0.9);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-wrapper {
        flex-direction: column;
    }
    
    .stats-bar {
        flex-wrap: wrap;
        padding: 8px;
    }
    
    .stat-item {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    #storeCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .tabs-container {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .upgrade-grid, .staff-grid, .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Tooltip system */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-size: 12px;
    margin-bottom: 5px;
    z-index: 10000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Login Screen Styles */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.login-container {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 450px;
    width: 90%;
}

.login-title {
    font-size: 3em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.login-subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1.1em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-input {
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.1em;
    transition: border-color 0.3s;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-btn {
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.login-info {
    margin-top: 20px;
    color: var(--text-light);
    font-size: 0.9em;
}

/* Slot Selection Screen */
.slot-selection-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-y: auto;
    z-index: 9999;
}

.slot-container {
    padding: 40px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.slot-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
}

.slot-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.slot-header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.logout-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.save-slot {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.save-slot:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.slot-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.slot-header-bar h3 {
    color: var(--primary-color);
    font-size: 1.3em;
}

.delete-slot-btn {
    padding: 5px 15px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.delete-slot-btn:hover {
    background: #d32f2f;
}

.slot-content {
    min-height: 150px;
    margin-bottom: 15px;
}

.empty-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
}

.empty-slot p:first-child {
    font-size: 2em;
    margin-bottom: 5px;
}

.slot-hint {
    font-size: 0.9em;
}

.slot-info {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 10px;
}

.slot-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.slot-info-row:last-child {
    margin-bottom: 0;
}

.slot-info-label {
    color: var(--text-light);
}

.slot-info-value {
    color: var(--text-dark);
    font-weight: bold;
}

.slot-action-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.slot-action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.slot-action-btn.continue {
    background: var(--success-color);
}

.slot-action-btn.continue:hover {
    background: #4CAF50;
}

@media (max-width: 900px) {
    .slots-grid {
        grid-template-columns: 1fr;
    }
    
    .logout-btn {
        position: static;
        display: block;
        margin: 20px auto 0;
    }
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.tutorial-card {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 350px;
    pointer-events: auto;
    border-left: 5px solid #4CAF50;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translate(-50%, 50px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.tutorial-card h3 {
    margin-top: 0;
    color: #2E7D32;
}

.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.8em;
    color: #666;
}

.tutorial-pointer {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0.3);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(76, 175, 80, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}


/* Updated Finance Tab Styles */
.finance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.finance-card {
    background: var(--bg-paper);
    padding: 12px;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.finance-card .label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
}

.finance-card .value {
    font-size: 16px;
    font-weight: 800;
    margin-top: 4px;
}

.value.positive { color: var(--primary-color); }
.value.negative { color: var(--danger-color); }

.finance-breakdown h4 {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.breakdown-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 12px;
}

.breakdown-item .cat {
    font-weight: 600;
}

/* Industrial UI Styles */
.factory-card {
    border: 1px solid #e0e0e0;
    transition: transform 0.2s;
}
.factory-card.owned {
    border-color: #4CAF50;
    background: #f1f8e9;
}
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 5px;
}
.status-badge.running {
    background: #4CAF50;
    color: white;
}
.status-badge.locked {
    background: #9e9e9e;
    color: white;
}
.product-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.85em;
    margin-right: 4px;
    margin-bottom: 2px;
}


/* Map Modal Styles */
.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.city-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.city-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.city-card.current {
    border-color: #4CAF50;
    background: #e8f5e9;
}
.city-card.locked {
    opacity: 0.6;
    background: #f5f5f5;
    border-color: #ccc;
}
.city-icon {
    font-size: 48px;
    margin-bottom: 10px;
}
.city-info h3 {
    margin: 5px 0;
    color: #333;
}
.city-info p {
    font-size: 0.9em;
    color: #666;
    min-height: 40px;
}
.city-bonus {
    margin: 10px 0;
    font-weight: bold;
    color: #FFC107;
    background: #333;
    padding: 4px;
    border-radius: 4px;
    font-size: 0.9em;
}

