/* Mushroom Module CSS Fixes - Z-index and Modal Issues */

/* Fix modal z-index issues */
.modal, 
#newStrainModal, 
#newCultureModal,
.modal-overlay {
    z-index: 9999 !important;
    position: fixed !important;
}

.modal-content,
.commercial-strain-modal,
.commercial-culture-modal {
    z-index: 10000 !important;
    position: relative !important;
    background: white;
    max-height: 90vh;
    overflow-y: auto;
}

/* Ensure modals appear on top */
.modal {
    display: none;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999 !important;
}

.modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999 !important;
}

/* Fix commercial forms modal */
.commercial-strain-modal,
.commercial-culture-modal {
    background: white;
    border-radius: 8px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Batch ID section */
.batch-id-generator {
    display: flex;
    gap: 10px;
    align-items: center;
}

.batch-id-generator input {
    flex: 1;
}

.batch-id-generator button {
    padding: 8px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.batch-id-generator button:hover {
    background: #45a049;
}

/* Species selector with add new */
.species-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.species-selector select {
    flex: 1;
}

.add-species-btn {
    padding: 8px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.add-species-btn:hover {
    background: #1976D2;
}

/* Form sections */
.form-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.form-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Culture age indicators */
.culture-age-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.age-fresh {
    background: #d4edda;
    color: #155724;
}

.age-optimal {
    background: #cce5ff;
    color: #004085;
}

.age-aging {
    background: #fff3cd;
    color: #856404;
}

.age-critical {
    background: #f8d7da;
    color: #721c24;
}

/* Auto-generate buttons */
.auto-generate-btn {
    padding: 6px 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.auto-generate-btn:hover {
    background: #5a6268;
}

/* Fix button spacing in header */
.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Ensure proper layering */
.mushrooms-container {
    position: relative;
    z-index: 1;
}

/* Stats grid improvements */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2e7d32;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.stat-card.warning .stat-value {
    color: #ff9800;
}

.stat-card.danger .stat-value {
    color: #f44336;
}
