/* =========================================================
   فایل: style.css
   مسیر: /home3/pishoool/public_html/mvp/style.css
   توضیحات: استایل‌های شبیه‌ساز یخچال هوشمند، افکت‌های هشدار و پنل آموزش زبان
   ========================================================= */
@import url('modal.css');

:root {
    --fridge-color: #f4f6f8;
    --fridge-dark: #bdc3c7;
    --inside-color: #ecf0f1;
    --text-color: #2c3e50;
    --bg-color: #2d3436;
}

body {
    font-family: Tahoma, Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: var(--text-color);
    overflow: hidden;
}

.appliance-scene {
    perspective: 1500px;
    width: 340px;
    height: 720px;
    position: relative;
    user-select: none;
}

.appliance-body {
    width: 100%;
    height: 100%;
    background-color: var(--fridge-color);
    border-radius: 15px;
    position: absolute;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset -10px -10px 20px rgba(0,0,0,0.05);
    transform-style: preserve-3d;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2% 0;
    box-sizing: border-box;
}

.compartment {
    position: relative;
    width: 100%;
    cursor: pointer;
    transform-style: preserve-3d;
}

.freezer-section { height: 38%; z-index: 2; }
.fridge-section { height: 60%; z-index: 1; }

.inside {
    width: 88%;
    height: 94%;
    background-color: var(--inside-color);
    position: absolute;
    top: 3%;
    left: 6%;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

/* لایه برفک فریزر */
.frost-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0) 10%, rgba(255,255,255,0.85) 90%), 
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.5" numOctaves="3"/></filter><rect width="100" height="100" filter="url(%23n)" opacity="0.3"/></svg>');
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 15; /* روی مواد غذایی */
    pointer-events: none;
    mix-blend-mode: screen;
}

.shelf {
    width: 90%;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    position: relative;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    z-index: 10;
}

.freezer-section .shelf { margin-top: 85px; }
.fridge-section .shelf { margin-top: 100px; }

.food-item {
    font-size: 30px;
    transform: translateY(2px);
    filter: drop-shadow(2px 5px 4px rgba(0,0,0,0.3));
    z-index: 12;
    transition: transform 0.2s;
    cursor: pointer; /* اضافه شدن نشانگر موس برای آموزش */
}

.food-item:hover {
    transform: translateY(2px) scale(1.15);
}

.inner-light {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 200, 0);
    transition: background-color 0.4s ease;
    z-index: 5;
    pointer-events: none;
}

.fridge-section.is-open .inner-light { background-color: rgba(255, 255, 200, 0.15); }
.freezer-section.is-open .inner-light { background-color: rgba(200, 240, 255, 0.15); }

.cold-air {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 0%;
    background: linear-gradient(to top, rgba(116, 185, 255, 0.5), transparent);
    transition: height 0.8s ease;
    z-index: 20;
    pointer-events: none;
}
.is-cooling .cold-air { height: 85%; }

.freezer-vapor {
    position: absolute;
    bottom: -10%; left: 0; right: 0;
    height: 70%;
    background: radial-gradient(ellipse at bottom, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%);
    filter: blur(12px);
    opacity: 0;
    z-index: 25;
    pointer-events: none;
    transform: translateY(0) scale(1);
}

.freezer-section.is-open .freezer-vapor {
    animation: vaporPour 3s infinite ease-in;
}

@keyframes vaporPour {
    0% { opacity: 0; transform: translateY(-20px) scale(0.9); }
    30% { opacity: 0.7; transform: translateY(10px) scale(1); }
    70% { opacity: 0.4; transform: translateY(40px) scale(1.1); }
    100% { opacity: 0; transform: translateY(70px) scale(1.2); }
}

.door {
    width: 100%;
    height: 100%;
    background-color: var(--fridge-color);
    position: absolute;
    top: 0; left: 0;
    transform-origin: right center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    border-left: 2px solid var(--fridge-dark);
    box-shadow: inset 5px 0 15px rgba(0,0,0,0.1), 5px 0 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 30;
    backface-visibility: hidden;
}

.is-open .door { transform: rotateY(110deg); }

.handle {
    width: 12px;
    background-color: #95a5a6;
    position: absolute;
    left: 15px;
    border-radius: 6px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.freezer-section .handle { height: 80px; bottom: 20px; }
.fridge-section .handle { height: 140px; top: 20px; }

.door-panel {
    background-color: #222;
    color: #00cec9;
    padding: 8px 15px;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #555;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
    text-shadow: 0 0 8px #00cec9;
    direction: ltr;
    text-align: center;
    width: 100px;
    transition: color 0.3s, text-shadow 0.3s;
}

.freezer-section .door-panel { margin-top: 30px; }
.fridge-section .door-panel { margin-top: 40px; }

.panel-label {
    font-size: 10px;
    color: #bdc3c7;
    text-shadow: none;
    display: block;
    margin-bottom: 2px;
}

/* =========================================================
   استایل‌های سیستم هشدار (Alarm System)
   ========================================================= */

/* تغییر رنگ نور داخلی به قرمز چشمک‌زن */
.compartment.alarm-mode.is-open .inner-light {
    animation: alarmFlash 1s infinite alternate;
}

@keyframes alarmFlash {
    0% { background-color: rgba(255, 0, 0, 0.1); }
    100% { background-color: rgba(255, 0, 0, 0.5); }
}

/* تغییر رنگ پنل نمایشگر در حالت هشدار */
.compartment.alarm-mode .door-panel {
    color: #ff4757 !important;
    text-shadow: 0 0 10px #ff4757 !important;
    border-color: #ff4757;
    animation: textFlash 0.5s infinite alternate;
}

@keyframes textFlash {
    0% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* =========================================================
   استایل‌های پنل آموزش زبان (Learning Flashcard)
   ========================================================= */

#learning-panel {
    /* موارد position: fixed، opacity و visibility حذف شدند تا توسط modal.css مدیریت شوند */
    background: linear-gradient(135deg, #0984e3, #74b9ff);
    color: white;
    padding: 30px 60px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,255,255,0.2);
    text-align: center;
    z-index: 1000;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.vocab-en {
    font-size: 45px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.4);
    letter-spacing: 2px;
}

.vocab-fa {
    font-size: 32px;
    font-family: Tahoma, 'Vazirmatn', sans-serif; /* فونت مناسب فارسی */
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 25px;
    border-radius: 12px;
    direction: rtl;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}
