/* style.css */
body { background-color: #2c3e50; color: white; font-family: sans-serif; display: flex; justify-content: center; height: 100vh; margin: 0; }

.lab-container { width: 800px; text-align: center; }

/* Raf ve Kimyasallar */
.shelf { background: #34495e; padding: 20px; border-radius: 10px; margin-bottom: 20px; }
.chemicals { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.chemical {
    background: #ecf0f1; color: #2c3e50; padding: 10px 15px;
    border-radius: 5px; cursor: grab; font-weight: bold;
    user-select: none; border: 2px solid #bdc3c7;
}

/* Beher ve Karıştırma */
.workspace { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.beaker-area {
    width: 200px; height: 250px; position: relative;
    border-bottom: 5px solid #fff; border-left: 2px solid rgba(255,255,255,0.5); border-right: 2px solid rgba(255,255,255,0.5);
    border-radius: 0 0 20px 20px; margin-top: 20px;
    background: linear-gradient(to bottom, transparent 50%, rgba(255,255,255,0.1) 50%);
}

.liquid {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 0%; background: #3498db;
    transition: height 0.5s, background-color 1s;
    border-radius: 0 0 15px 15px;
}

/* Animasyon Sınıfları */
.effect-heat {
    box-shadow: 0 -20px 40px rgba(255, 69, 0, 0.6);
    animation: steam 2s infinite;
}

.effect-explosion {
    animation: shake 0.5s;
    background: radial-gradient(circle, yellow, red);
}

@keyframes steam {
    0% { opacity: 0; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-20px); }
    100% { opacity: 0; transform: translateY(-40px); }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.result-panel { margin-top: 20px; padding: 15px; background: rgba(0,0,0,0.5); border-radius: 8px; min-height: 80px; }
.formula { font-family: 'Courier New', monospace; color: #f1c40f; font-size: 1.2em; }

.btn-mix { padding: 10px 30px; font-size: 18px; cursor: pointer; background: #2ecc71; border: none; color: white; border-radius: 5px; }
.btn-reset { padding: 10px 30px; cursor: pointer; background: #e74c3c; border: none; color: white; border-radius: 5px; }

/* Duman Efekti (HCl + NH3 için) */
.effect-smoke {
    animation: smokeRise 3s infinite;
    background: linear-gradient(to top, rgba(255,255,255,0.8), rgba(255,255,255,0));
}

@keyframes smokeRise {
    0% { filter: blur(2px); opacity: 0.4; transform: translateY(0) scale(1); }
    50% { filter: blur(5px); opacity: 0.8; transform: translateY(-20px) scale(1.2); }
    100% { filter: blur(10px); opacity: 0; transform: translateY(-50px) scale(1.5); }
}

/* Çökelti Efekti (Bulanık, tortulu sıvı) */
.effect-precipitate {
    background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="white" opacity="0.5"/></svg>');
    background-color: rgba(255, 255, 255, 0.3);
    animation: precipitateFall 5s linear;
}

@keyframes precipitateFall {
    from { background-position: 0 0; }
    to { background-position: 0 100px; }
}

/* Kahverengi Gaz (NO2) */
.effect-gas_brown {
    box-shadow: 0 -30px 50px rgba(139, 69, 19, 0.6);
    animation: steam 3s infinite; /* Mevcut steam animasyonunu kullanabiliriz */
}
/* --- GAZ VE BALONCUK EFEKTLERİ --- */

/* Baloncuk Animasyonu Tanımı */
@keyframes bubbleRise {
    0% {
        bottom: 0;
        opacity: 0;
        transform: translateX(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        bottom: 100%; /* Sıvının en tepesine kadar çık */
        opacity: 0;
        transform: translateX(-5px); /* Hafif sola kayarak çıkar */
    }
}

/* effect-gas sınıfı eklendiğinde çalışacak yapı */
/* .beaker-area.effect-gas .liquid içine sanal element ekliyoruz */

.effect-gas .liquid::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* Baloncuk Görünümü: Çoklu radyal gradient ile rastgele noktalar */
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.8) 2px, transparent 3px),
        radial-gradient(circle, rgba(255,255,255,0.6) 3px, transparent 4px),
        radial-gradient(circle, rgba(255,255,255,0.4) 2px, transparent 3px);
    
    /* Baloncukların konumları */
    background-position: 20% 90%, 50% 90%, 80% 90%; 
    background-size: 20px 100%; /* Dikeyde uzayan bir alan */
    background-repeat: repeat-y;
    
    /* Animasyonu başlat */
    animation: bubbleRise 1s linear infinite;
    z-index: 10;
}

/* Eğer "Hızlı Gaz" (gas_fast) ise daha hızlı hareket etsin */
.effect-gas_fast .liquid::after {
    animation: bubbleRise 0.4s linear infinite; /* Çok daha hızlı */
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.9) 3px, transparent 4px),
        radial-gradient(circle, rgba(255,255,255,0.7) 4px, transparent 5px);
}

/* "Hızlı Gaz" durumunda kaba titreme efekti de verelim */
.shake-mild {
    animation: mildShake 0.5s infinite;
}

@keyframes mildShake {
    0% { transform: translate(1px, 1px); }
    50% { transform: translate(-1px, -1px); }
    100% { transform: translate(1px, -1px); }
}
/* Basit baloncuk animasyonu için pseudo-element kullanılabilir veya JS ile particle eklenebilir. 
   Burada basitçe titreme ve renk değişimi kullanıyoruz */

/* Çökeltiler */
.effect-precipitate_white {
    background-image: radial-gradient(circle, #fff 10%, transparent 10%);
    background-size: 10px 10px;
    opacity: 0.9;
}
.effect-precipitate_blue {
    background-color: #00008B !important;
    background-image: radial-gradient(circle, #4fa3ff 10%, transparent 10%);
    background-size: 8px 8px;
}
.effect-precipitate_dark {
    background-color: #3e2723 !important;
    opacity: 0.95;
}

/* Metal Kaplanması (Sıvının dibinde tortu gibi) */
.effect-metal_coat_copper {
    border-bottom: 20px solid #b87333; /* Beher dibinde bakır birikimi simülasyonu */
    box-shadow: inset 0 -10px 20px #b87333;
}
.effect-metal_coat_silver {
    border-bottom: 20px solid #bdc3c7;
    box-shadow: inset 0 -10px 20px #7f8c8d;
}
/* --- MADDELERİN RENK KODLARI --- */

/* Temel Kutu Ayarı */
.chemical {
    padding: 12px 18px;
    border-radius: 8px;
    cursor: grab;
    font-weight: bold;
    user-select: none;
    border: 2px solid rgba(0,0,0,0.1); /* Hafif çerçeve */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.1s;
    color: white; /* Yazılar beyaz olsun */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.chemical:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* 1. ASİTLER: Tehlike ve yakıcılığı temsilen KIRMIZI/TURUNCU */
.acid {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* 2. BAZLAR: Kimyada bazlar genellikle MAVİ ile kodlanır */
.base {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* 3. METALLER: Metalik GRİ */
.metal {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: #ecf0f1;
}

/* Özel: Bakır (Cu) kendine has turuncumsu metal renginde olsun */
.metal.copper {
    background: linear-gradient(135deg, #d35400, #a04000);
}

/* 4. TUZLAR: Genellikle NÖTR/BEYAZ veya TARTIŞILIR renkler */
/* Standart Tuzlar (Beyazımsı/Krem) - Yazı rengini koyu yapalım */
.salt {
    background: linear-gradient(135deg, #f1c40f, #f39c12); /* Sarı tonları */
    color: white;
}

/* Göztaşı (CuSO4) Mavi olduğu için özel stil */
.salt.blue-salt {
    background: linear-gradient(135deg, #0000ff, #00008b);
}

/* Nötr/Beyaz Tuzlar (NaCl, CaCO3 gibi) için alternatif açık renk */
/* Eğer sarı istemezsen bunu kullanabilirsin:
.salt {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    color: #2c3e50; 
    border-color: #95a5a6;
}
*/
/* style.css sonuna ekle */

/* Bilgi Butonu */
.btn-info {
    padding: 10px 30px;
    background: #3498db; /* Mavi */
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
}
.btn-info:hover { background: #2980b9; }

/* Bilgi Paneli (Gizli Başlangıç) */
.info-panel {
    position: fixed;
    bottom: -100%; /* Ekran dışı */
    left: 0;
    width: 100%;
    height: 70%; /* Ekranın %70'ini kapla */
    background: rgba(44, 62, 80, 0.98); /* Arka plan rengiyle uyumlu opak */
    color: #ecf0f1;
    transition: bottom 0.5s ease-in-out;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    z-index: 1000;
    border-top: 4px solid #f1c40f;
    display: flex;
    justify-content: center;
}

/* Panel Açıkken */
.info-panel.open {
    bottom: 0;
}

.info-content {
    width: 800px;
    padding: 30px;
    overflow-y: auto; /* İçerik uzunsa kaydır */
    position: relative;
}

/* Renk Kodları Kutuları */
.legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.color-box {
	display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #fff;
}
/* Renkleri yukarıdaki kodlardan miras alıyoruz */

/* Tablo Stilleri */
.table-wrapper {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid #7f8c8d;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #34495e;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #2c3e50;
}

th {
    background: #2c3e50;
    position: sticky;
    top: 0;
}

tr:hover { background: #3e5871; }

.btn-close {
    margin-top: 20px;
    padding: 10px 20px;
    background: #c0392b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    float: right;
}

#searchBox {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: none;
}
/* --- YENİ RENKLER --- */
.oxidizer { background: linear-gradient(135deg, #8e44ad, #9b59b6); } /* Morumsu */
.purple-metal { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.rust { background: linear-gradient(135deg, #d35400, #e67e22); }

/* --- 1. FİL DİŞİ MACUNU (KÖPÜK) EFEKTİ --- */
@keyframes foamUp {
    0% { height: 10%; transform: scale(1); border-radius: 0 0 15px 15px; }
    50% { height: 100%; transform: scaleX(1.1); border-radius: 5px; }
    100% { height: 140%; top: -40%; transform: scaleX(1.2); border-radius: 10px 10px 0 0; box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
}

.effect-foam_eruption .liquid {
    background: repeating-radial-gradient(
      circle,
      #fffef0,
      #fffef0 5px,
      #f1c40f 6px,
      #f1c40f 10px
    );
    animation: foamUp 2s forwards ease-out; /* Taşar ve orada kalır */
}
/* Köpüğün taştığını göstermek için z-index oynu */
.effect-foam_eruption { overflow: visible !important; z-index: 10; }


/* --- 2. TERMİT TEPKİMESİ (KIVILCIM VE IŞIK) --- */
@keyframes blindingLight {
    0% { box-shadow: 0 0 0 rgba(255, 69, 0, 0); background-color: #333; }
    10% { box-shadow: 0 0 100px 50px rgba(255, 255, 255, 1); background-color: #fff; } /* Kör edici an */
    30% { box-shadow: 0 0 60px 30px rgba(255, 165, 0, 0.8); background-color: #ff4500; }
    100% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.5); background-color: #8b0000; } /* Erimiş demir koru */
}

@keyframes sparks {
    0% { background-position: 50% 50%; opacity: 1; }
    100% { background-position: 200% 200%; opacity: 0; }
}

.effect-thermite .liquid {
    /* Kıvılcım efekti için gürültülü gradient */
    background-image: radial-gradient(white 15%, transparent 16%),
                      radial-gradient(white 15%, transparent 16%);
    background-size: 10px 10px;
    background-position: 0 0, 30px 30px;
    animation: blindingLight 4s forwards, sparks 0.5s linear infinite;
}


/* --- 3. MOR PATLAMA (POTASYUM) --- */
@keyframes purpleExplosion {
    0% { transform: scale(1); background: #333; }
    50% { transform: scale(1.2) rotate(5deg); background: radial-gradient(circle, #fff, #8e44ad); }
    100% { transform: scale(1); background: #333; opacity: 0.5; }
}

.effect-explosion_purple {
    animation: purpleExplosion 0.6s ease-in-out;
    box-shadow: 0 0 50px #8e44ad;
}
/* Beherdeki .liquid sınıfı ile karışmaması için özel isim verdik */
.water-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}
/* Beher Üzerindeki Bilgi Ekranı */
.beaker-display {
    width: 220px;
    min-height: 60px;
    background: #2c3e50;
    border: 2px solid #34495e;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px; /* Beher ile arasına boşluk */
    color: #00f2ff; /* Neon mavi yazı */
    font-family: 'Courier New', monospace;
    font-size: 13px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.placeholder-text {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    margin-top: 15px;
}

.chem-info-line {
    border-bottom: 1px dashed #34495e;
    padding-bottom: 2px;
}