/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.7);
    --accent-color: #f78166;
    /* Industrial Orange */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border-color: rgba(240, 246, 252, 0.1);
    --glass-border: rgba(255, 255, 255, 0.05);
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(247, 129, 102, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(58, 134, 255, 0.05) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--card-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

header {
    padding: 1.5rem 3rem;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property for compatibility */
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(247, 129, 102, 0.3);
}

.status-pills {
    display: flex;
    gap: 1rem;
}

.pill {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.pill.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(247, 129, 102, 0.1);
    box-shadow: 0 0 15px rgba(247, 129, 102, 0.1);
}

.pill.clock {
    border-color: var(--text-secondary);
    min-width: 140px;
}

#btn-export {
    transition: all 0.3s;
    border: 1px solid var(--success);
    color: var(--success);
    background: rgba(63, 185, 80, 0.1);
    cursor: pointer;
    font-weight: 600;
}

#btn-export:hover {
    background: var(--success);
    color: white;
    box-shadow: 0 0 15px rgba(63, 185, 80, 0.4);
}

main {
    padding: 2rem 3rem;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    flex: 1;
}

.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Warehouse Map Styles */
.warehouse-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 1fr;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

/* Warehouse Legend */
.warehouse-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.success {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.dot.warning {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

.dot.critical {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.card.mini {
    padding: 1.2rem;
}

.chart-box {
    height: 80px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 5px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 100%;
    width: 100%;
}

.bar {
    flex: 1;
    background: var(--accent-color);
    border-radius: 4px 4px 0 0;
    transition: height 1s ease-out;
    opacity: 0.6;
}

.bar:hover {
    opacity: 1;
}

.clean-list {
    list-style: none;
    font-size: 0.85rem;
}

.clean-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.shelve {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.shelve:hover {
    background: rgba(247, 129, 102, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.shelve.selected {
    background: rgba(247, 129, 102, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(247, 129, 102, 0.2);
}

.shelve-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

.occupancy-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    position: absolute;
    top: 10px;
    right: 10px;
}

.occupancy-dot.occupied {
    background: var(--success);
}

.occupancy-dot.warning {
    background: var(--warning);
}

.occupancy-dot.critical {
    background: var(--danger);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem;
    color: white;
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--accent-color);
}

button {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(247, 129, 102, 0.3);
}

button.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

button.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Tool Detail List */
.tool-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-left: 3px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.tool-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.tool-item.active {
    background: rgba(247, 129, 102, 0.1);
    border-left-color: var(--accent-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 400px;
    text-align: center;
    padding: 2rem;
}

.mock-qr {
    width: 200px;
    height: 200px;
    background: white;
    margin: 1.5rem auto;
    padding: 10px;
    border-radius: 8px;
    position: relative;
    background-image:
        linear-gradient(45deg, #000 25%, transparent 25%),
        linear-gradient(-45deg, #000 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #000 75%),
        linear-gradient(-45deg, transparent 75%, #000 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.premium-promo {
    background: linear-gradient(135deg, rgba(63, 185, 80, 0.1) 0%, rgba(58, 134, 255, 0.1) 100%);
    border-color: rgba(63, 185, 80, 0.3);
}

.tool-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.tool-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.life-bar-container {
    width: 100px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.life-bar {
    height: 100%;
    background: var(--success);
    transition: width 0.5s ease;
}

@media (max-width: 1100px) {
    main {
        grid-template-columns: 1fr;
    }
}