/* =================================================================
   UNDERGROUND FARMER - FARM LABORATORY CSS
   ================================================================= */

/* Farm Research Modal */
.farm-research-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.farm-research-modal.active {
    opacity: 1;
    visibility: visible;
}

.farm-research-modal-content {
    background: linear-gradient(135deg, #2a2a3a 0%, #1a1a2a 100%);
    border: 3px solid #4a4a6a;
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.farm-research-modal.active .farm-research-modal-content {
    transform: scale(1);
}

/* Modal Header */
.farm-research-header {
    background: linear-gradient(135deg, #4a4a6a 0%, #3a3a5a 100%);
    border-bottom: 2px solid #6a6a8a;
    padding: 20px;
    position: relative;
    border-radius: 13px 13px 0 0;
}

.farm-research-title {
    font-size: 24px;
    font-weight: bold;
    color: #e6e6ff;
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.farm-research-subtitle {
    font-size: 14px;
    color: #b8b8d8;
    text-align: center;
    opacity: 0.9;
}

.farm-research-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ff4444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.farm-research-close:hover {
    background: #ff6666;
    transform: scale(1.1);
}

/* Research Tabs */
.farm-research-tabs {
    display: flex;
    background: linear-gradient(135deg, #3a3a4a 0%, #2a2a3a 100%);
    border-bottom: 2px solid #5a5a7a;
}

.farm-research-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: #b8b8d8;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.farm-research-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e6e6ff;
}

.farm-research-tab.active {
    color: #87ceeb;
    border-bottom-color: #87ceeb;
    background: rgba(135, 206, 235, 0.1);
}

.farm-research-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.farm-research-tab:hover::before {
    left: 100%;
}

/* Research Content */
.farm-research-content {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.farm-research-content::-webkit-scrollbar {
    width: 12px;
}

.farm-research-content::-webkit-scrollbar-track {
    background: linear-gradient(135deg, #1a1a2a 0%, #2a2a3a 100%);
    border-radius: 6px;
}

.farm-research-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4a4a6a 0%, #3a3a5a 100%);
    border-radius: 6px;
    border: 2px solid #2a2a3a;
}

.farm-research-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a5a7a 0%, #4a4a6a 100%);
}

/* Research Section */
.research-section h3 {
    color: #e6e6ff;
    font-size: 20px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.research-section p {
    color: #b8b8d8;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Research Items */
.research-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.research-item {
    background: linear-gradient(135deg, #3a3a4a 0%, #2a2a3a 100%);
    border: 2px solid #5a5a7a;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.research-item:hover {
    border-color: #7a7a9a;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.research-item.advanced {
    border-color: #8a4a8a;
    background: linear-gradient(135deg, #4a3a4a 0%, #3a2a3a 100%);
}

.research-item.advanced:hover {
    border-color: #aa6aaa;
}

.research-item.experimental {
    border-color: #8a8a4a;
    background: linear-gradient(135deg, #4a4a3a 0%, #3a3a2a 100%);
}

.research-item.experimental:hover {
    border-color: #aaaa6a;
}

/* Research Item Header */
.research-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.research-item-title {
    font-size: 16px;
    font-weight: bold;
    color: #e6e6ff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.research-item-level {
    background: rgba(135, 206, 235, 0.2);
    color: #87ceeb;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

/* Research Item Content */
.research-item-desc {
    color: #b8b8d8;
    margin-bottom: 15px;
    line-height: 1.4;
    font-size: 14px;
}

.research-item-effect {
    color: #daa520;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 14px;
}

.research-item-effect.unlocked {
    color: #32cd32;
}

/* Research Item Footer */
.research-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.research-item-cost {
    color: #87ceeb;
    font-weight: bold;
    font-size: 14px;
}

.research-upgrade-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4a6a4a 0%, #3a5a3a 100%);
    border: 2px solid #6a8a6a;
    border-radius: 8px;
    color: #e6ffe6;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.research-upgrade-btn:hover {
    background: linear-gradient(135deg, #5a7a5a 0%, #4a6a4a 100%);
    border-color: #7a9a7a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.research-upgrade-btn.advanced {
    background: linear-gradient(135deg, #6a4a6a 0%, #5a3a5a 100%);
    border-color: #8a6a8a;
    color: #ffe6ff;
}

.research-upgrade-btn.advanced:hover {
    background: linear-gradient(135deg, #7a5a7a 0%, #6a4a6a 100%);
    border-color: #aa8aaa;
}

.research-upgrade-btn.experimental {
    background: linear-gradient(135deg, #6a6a4a 0%, #5a5a3a 100%);
    border-color: #8a8a6a;
    color: #ffffe6;
}

.research-upgrade-btn.experimental:hover {
    background: linear-gradient(135deg, #7a7a5a 0%, #6a6a4a 100%);
    border-color: #aaaa8a;
}

.research-upgrade-btn:disabled {
    background: #444;
    border-color: #666;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.research-upgrade-btn:disabled:hover {
    background: #444;
    border-color: #666;
    transform: none;
    box-shadow: none;
}

/* Nuclear Seeds Preview */
.nuclear-seeds-preview {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.nuclear-seed-preview {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #32cd32;
    border: 1px solid rgba(50, 205, 50, 0.3);
}

.nuclear-seed-preview.locked {
    color: #888;
    border-color: rgba(136, 136, 136, 0.3);
}

/* Animations */
@keyframes researchGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(135, 206, 235, 0.3); }
    50% { box-shadow: 0 0 20px rgba(135, 206, 235, 0.6); }
}

.research-item:hover {
    animation: researchGlow 2s ease-in-out infinite;
}

.research-item.advanced:hover {
    animation: researchAdvancedGlow 2s ease-in-out infinite;
}

@keyframes researchAdvancedGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(170, 106, 170, 0.3); }
    50% { box-shadow: 0 0 20px rgba(170, 106, 170, 0.6); }
}

.research-item.experimental:hover {
    animation: researchExperimentalGlow 2s ease-in-out infinite;
}

@keyframes researchExperimentalGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(170, 170, 106, 0.3); }
    50% { box-shadow: 0 0 20px rgba(170, 170, 106, 0.6); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .farm-research-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .farm-research-header {
        padding: 15px;
    }
    
    .farm-research-title {
        font-size: 20px;
    }
    
    .farm-research-tabs {
        flex-direction: column;
    }
    
    .farm-research-tab {
        padding: 12px 15px;
        font-size: 12px;
    }
    
    .farm-research-content {
        padding: 20px;
    }
    
    .research-item {
        padding: 15px;
    }
    
    .research-item-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .research-upgrade-btn {
        width: 100%;
        justify-content: center;
    }
    
    .nuclear-seeds-preview {
        grid-template-columns: 1fr;
    }
}

/* Integration with existing lab system */
.lab-category[data-category="farm"] .category-name::after {
    content: " 🧪";
    color: #87ceeb;
    font-size: 0.8em;
    margin-left: 5px;
}

/* Special effects for unlocked research */
.research-item-effect.unlocked::before {
    content: "✅ ";
    color: #32cd32;
    font-weight: bold;
}

.research-item.maxed {
    border-color: #daa520;
    background: linear-gradient(135deg, #4a4a3a 0%, #3a3a2a 100%);
}

.research-item.maxed .research-item-title {
    color: #daa520;
}

.research-item.maxed .research-item-level {
    background: rgba(218, 165, 32, 0.3);
    color: #daa520;
}

/* Loading states */
.research-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #b8b8d8;
    font-size: 16px;
}

.research-loading::before {
    content: "🔬";
    font-size: 32px;
    margin-right: 10px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
} 