:root {
    --bg-color: #0d0d0d;
    --panel-bg: #1a1a1a;
    --text-main: #cecece;
    --text-highlight: #9a8866;
    /* Tarkov Gold */
    --accent: #d4a017;
    --alert-red: #8b0000;
    --border-color: #333;
    --font-stack: 'Share Tech Mono', monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-stack);
    margin: 0;
    padding: 0;
    /* background-image: url('grid-texture.png'); Disabled due to missing file */
    /* Placeholder for texture */
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: var(--panel-bg);
    border-bottom: 2px solid var(--text-highlight);
}

.nav-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-highlight);
    letter-spacing: 2px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 18px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--accent);
}

.btn-toggle {
    background: transparent;
    border: 1px solid var(--text-highlight);
    color: var(--text-highlight);
    padding: 5px 15px;
    cursor: pointer;
    font-family: var(--font-stack);
}

.btn-action {
    background-color: var(--text-highlight);
    color: #000;
    padding: 8px 20px;
    border-radius: 2px;
}

/* Content */
.container {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.sellout-alert {
    background-color: var(--alert-red);
    color: #fff;
    text-align: center;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    display: none;
    /* Hidden by default */
    border: 2px solid red;
    animation: flash 1s infinite alternate;
}

h1 {
    color: var(--text-highlight);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Sellout Columns */
.sellout-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.sellout-column {
    flex: 1;
    min-width: 300px;
    background: #111;
    padding: 10px;
    border: 1px solid #333;
}

.column-header {
    text-align: center;
    background: #222;
    padding: 10px;
    margin-top: 0;
    font-size: 18px;
    color: var(--text-highlight);
    border-bottom: 2px solid var(--accent);
}

.sellout-grid-column {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

/* Modern Archive Styles */
.sellout-card {
    background-color: rgba(20, 20, 20, 0.95);
    border: 1px solid #333;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s ease;
    font-size: 0.9em;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.sellout-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-highlight);
    box-shadow: 0 6px 12px rgba(154, 136, 102, 0.1);
}

/* Archive Specifics */
.sellout-column.past .sellout-card {
    opacity: 0.7;
    filter: grayscale(0.6);
    padding: 8px;
    min-height: auto;
}

.sellout-column.past .sellout-card:hover {
    opacity: 1;
    filter: grayscale(0);
}

/* Item Grid inside Card */
.sellout-items-group {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 4px;
    width: 100%;
}

.mini-item {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mini-item img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

/* Footer strip for user info and delete */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 8px;
    padding-top: 5px;
    border-top: 1px solid #222;
    font-size: 11px;
    color: #666;
}

.btn-delete-icon {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 14px;
    padding: 0 5px;
}

.btn-delete-icon:hover {
    color: #ff4444;
}

.sellout-grid-column {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    /* Slightly narrower */
    gap: 10px;
    margin-top: 15px;
}

.sellout-column.past .sellout-grid-column {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

/* Top Requests */
.request-item-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #333;
}

.request-item-row:last-child {
    border-bottom: none;
}

.request-count-badge {
    background: var(--accent);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
}

/* Footer */
footer {
    margin-top: 50px;
    background-color: #080808;
    border-top: 1px solid #222;
    padding: 40px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-col h3 {
    color: var(--text-highlight);
    font-size: 16px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.footer-col p,
.footer-col .credits {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.kofi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #29abe0;
    /* Ko-fi Blue */
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

.kofi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 171, 224, 0.4);
    background: #29abe0;
    /* Keep blue */
}

.kofi-btn img {
    height: 20px;
    width: auto;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    animation: kofi-wiggle 3s infinite;
}

@keyframes kofi-wiggle {

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

    5% {
        transform: rotate(-10deg);
    }

    10% {
        transform: rotate(10deg);
    }

    15% {
        transform: rotate(-10deg);
    }

    20% {
        transform: rotate(10deg);
    }

    25% {
        transform: rotate(0);
    }
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #111;
    color: #444;
    font-size: 11px;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .sellout-wrapper {
        flex-direction: column-reverse;
    }

    .sellout-column {
        width: 100%;
        margin-bottom: 20px;
    }

    .sellout-grid-column {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }

    .modal {
        width: 95%;
        margin: 20px auto;
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .nav-menu {
        gap: 10px;
        font-size: 14px;
    }

    .nav-link {
        font-size: 14px;
    }

    h1 {
        font-size: 24px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col h3 {
        width: 100%;
        border-bottom: 1px solid var(--accent);
    }
}

@keyframes flash {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.5;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

.modal {
    background: var(--panel-bg);
    border: 1px solid var(--text-highlight);
    width: 90%;
    max-width: 600px;
    padding: 20px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

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

.modal-header h2 {
    margin: 0;
    color: var(--text-highlight);
}

.close-modal {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #888;
    font-size: 14px;
}

input[type="text"],
input[type="datetime-local"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    background: #0d0d0d;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: inherit;
    box-sizing: border-box;
}

input:focus {
    border-color: var(--text-highlight);
    outline: none;
}

/* Search Dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #000;
    border: 1px solid var(--text-highlight);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.search-item {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-bottom: 1px solid #222;
}

.search-item:hover {
    background: #222;
}

.search-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* Added Items List */
.added-items {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.added-item-row {
    display: flex;
    justify-content: space-between;
    background: #111;
    padding: 5px 10px;
    margin-bottom: 5px;
    align-items: center;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: #111;
    color: #fff;
    border: 1px solid var(--text-highlight);
    padding: 15px 25px;
    margin-top: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out forwards;
}

.toast.success {
    border-left: 4px solid #44ff44;
}

.toast.error {
    border-left: 4px solid #ff4444;
}

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

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

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Inline Quantity Input */
.quantity-input {
    background: #000;
    border: 1px solid #444;
    color: #fff;
    width: 60px;
    padding: 5px;
    text-align: center;
    margin-left: 10px;
}