* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 2px solid #0f3460;
    padding: 20px 0;
    text-align: center;
}

header h1 {
    color: #00d4ff;
    font-size: 2.5rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    margin-bottom: 10px;
}

header p {
    color: #a0a0a0;
    font-size: 1.1rem;
}

main {
    padding: 40px 0;
}

.calculator-container {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #0f3460;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.input-section, .output-section {
    margin-bottom: 30px;
}

h2 {
    color: #00d4ff;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

h3 {
    color: #ffaa00;
    font-size: 1.3rem;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.search-container {
    margin-bottom: 20px;
}

#searchInput {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #0f3460;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.reagent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.reagent-card {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.reagent-card:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.reagent-card.selected {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.reagent-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.reagent-details h4 {
    color: #e0e0e0;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.reagent-details p {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.selected-reagent {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00ff88;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.reagent-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quantity-input label {
    color: #e0e0e0;
    font-weight: bold;
}

#quantityInput {
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #0f3460;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    width: 120px;
}

#quantityInput:focus {
    outline: none;
    border-color: #00d4ff;
}

#calculateBtn {
    background: linear-gradient(45deg, #00d4ff, #0088cc);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#calculateBtn:hover {
    background: linear-gradient(45deg, #00ff88, #00cc66);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.recipe-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 25px;
}

.target-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 10px;
    border: 1px solid #00ff88;
}

.reagent-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.3rem;
    font-weight: bold;
}

.ingredients-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 4px solid #00d4ff;
}

.ingredient-amount {
    color: #00ff88;
    font-weight: bold;
    font-size: 1.1rem;
}

.instructions-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.instructions-list li {
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 4px solid #ffaa00;
}

.tips-list {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid #ffaa00;
    border-radius: 8px;
    padding: 20px;
}

.tips-list li {
    margin-bottom: 8px;
    color: #ffd700;
}

.reset-button {
    background: linear-gradient(45deg, #ff6b6b, #cc5555);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto 0;
}

.reset-button:hover {
    background: linear-gradient(45deg, #ff8e8e, #dd6666);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

footer {
    background: rgba(0, 0, 0, 0.8);
    border-top: 2px solid #0f3460;
    padding: 20px 0;
    text-align: center;
    color: #a0a0a0;
    margin-top: 40px;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: #0f3460;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00d4ff;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .reagent-grid {
        grid-template-columns: 1fr;
    }
    
    .quantity-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .reagent-display {
        flex-direction: column;
        gap: 10px;
    }
}

/* Animation for loading */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Hidden class */
.hidden {
    display: none !important;
}