/* ProductionBlue Pro Max Style */

.craft-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    animation: fadeIn 0.5s ease-out;
}

@media (min-width: 1024px) {
    .craft-container {
        grid-template-columns: 2fr 1fr;
    }
}

/* Left Panel: The Blueprints */
.blueprint-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-selector-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
}

.product-holo {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.1) 0%, rgba(0, 0, 0, 0.6) 80%);
    border: 2px solid var(--primary-dim);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2), inset 0 0 10px rgba(0, 243, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-holo::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 2px;
    background: rgba(0, 243, 255, 0.5);
    top: 50%;
    animation: scan 3s linear infinite;
    opacity: 0.5;
}

@keyframes scan {
    0% {
        transform: translateY(-60px) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(60px) rotate(0deg);
        opacity: 0;
    }
}

.product-holo img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    z-index: 2;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.material-slots {
    display: grid;
    gap: 1rem;
}

.material-slot-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.2s;
}

.material-slot-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-dim);
    transform: translateX(5px);
}

.mat-icon-frame {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mat-result-text {
    font-family: 'Space Grotesk', monospace;
    color: var(--primary);
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

/* Calculator Bar */
.calc-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.6);
    /* Light glass */
    padding: 1rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-sm);
}

.calc-results-display {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #ecfdf5;
    /* Emerald 50 - Very light green */
    border: 1px solid #10b981;
    /* Emerald 500 */
    border-radius: var(--radius-md);
    color: #065f46;
    /* Emerald 800 */
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.calc-results-display:empty {
    display: none;
}

/* Right Panel: Inventory */
.inventory-panel {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--glass-heavy);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
    min-height: 3rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.tag:hover {
    border-color: var(--text-muted);
}

.tag.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.tag.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Notice Board Container */
#noticeBoard {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 300px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    /* Newest at bottom if appended, or top if prepended. Usually stacking up is better. */
    gap: 1rem;
    pointer-events: none;
    /* Let clicks pass through empty areas */
}

/* Individual Notice Popup */
.notice-popup {
    /* Position handled by parent flex container */
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    /* Light theme background */
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 1rem;
    pointer-events: auto;
    /* Re-enable clicks */
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Material Categories (Legacy Support for #mt_match) */
option.wood {
    background-color: #fef3c7;
    /* Amber 100 */
    color: #92400e;
    /* Amber 800 */
}

option.mineral {
    background-color: #f1f5f9;
    /* Slate 100 */
    color: #475569;
    /* Slate 600 */
}

option.cloth {
    background-color: #e0e7ff;
    /* Indigo 100 */
    color: #3730a3;
    /* Indigo 800 */
}

option.flower {
    background-color: #ffe4e6;
    /* Rose 100 */
    color: #9f1239;
    /* Rose 800 */
}

option.food {
    background-color: #ffedd5;
    /* Orange 100 */
    color: #9a3412;
    /* Orange 800 */
}

option.special {
    background-color: #ccfbf1;
    /* Teal 100 */
    color: #115e59;
    /* Teal 800 */
}

/* Responsive Design Overrides */
@media (max-width: 768px) {
    .craft-container {
        grid-template-columns: 1fr;
    }

    .product-selector-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .controls-grid {
        width: 100%;
    }

    .calc-bar {
        flex-direction: column;
        gap: 1rem;
        border-radius: var(--radius-md);
    }

    .calc-bar label,
    .calc-bar div,
    .calc-bar button {
        width: 100%;
        justify-content: center;
    }

    .calc-bar div {
        text-align: center;
        margin-right: 0 !important;
    }

    /* Force full width for inputs in mobile calc bar */
    .calc-bar input[type="text"] {
        width: 100% !important;
    }

    #noticeBoard {
        width: 90vw;
        right: 5vw;
        bottom: 1rem;
    }

    /* Ensure inventory panel sits nicely below */
    .inventory-panel {
        margin-top: 1rem;
    }
}