* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body {
    background: url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?q=80&w=2070&auto=format&fit=crop') no-repeat center center fixed;
    background-size: cover;
    color: white;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

body::before {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 25, 47, 0.4); z-index: -1;
}

.dashboard { display: flex; gap: 30px; padding: 40px; height: 100%; }

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    
    /* Raspberry Pi bulanıklık bozulmasını önleyen hile */
    transform: translateZ(0); 
    -webkit-transform: translateZ(0);
}

.left-panel { width: 300px; display: flex; flex-direction: column; gap: 20px; }

.time-card { background: rgba(56, 89, 180, 0.7); text-align: center; padding: 30px; }
.time-card h1 { font-size: 3.5rem; margin-bottom: 10px; font-weight: bold; }
.time-card p { font-size: 1.1rem; color: #e0e0e0; }

.widget-card h3 { font-size: 0.85rem; letter-spacing: 1px; margin-bottom: 15px; color: #ccc; }
.circles { display: flex; justify-content: space-around; }

/* Dinamik Dairesel Performans Göstergesi */
.circle {
    width: 75px; height: 75px; 
    border-radius: 50%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
    --deg: 0deg; /* JavaScript'ten değişecek değişken */
}

.circle span { font-weight: bold; font-size: 1.1rem; }
.circle small { font-size: 0.7rem; color: #ccc; }

.circle::before {
    content: ""; position: absolute; inset: 0;
    border-radius: 50%; padding: 5px; /* Halka kalınlığı */
    background: conic-gradient(#4a90e2 var(--deg), rgba(255, 255, 255, 0.1) 0deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.5s ease-out; /* Doldurma animasyonu yumuşatması */
}

.progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; margin-bottom: 10px;}
.progress-bar .fill { height: 100%; background: #00ff88; border-radius: 3px; transition: width 0.5s ease;}
.small-text { font-size: 0.8rem; color: #aaa; text-align: center; }

.right-panel { flex: 1; display: flex; flex-direction: column; padding-left: 20px; }
.header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; margin-bottom: 30px; }
.header h2 { font-weight: 500; font-size: 1.8rem; }
.status-badge { background: rgba(0, 255, 100, 0.2); padding: 8px 15px; border-radius: 20px; display: flex; align-items: center; gap: 8px; font-size: 0.9rem;}
.dot { width: 10px; height: 10px; background: #00ff88; border-radius: 50%; box-shadow: 0 0 10px #00ff88;}

.section-title { font-size: 1.2rem; font-weight: 400; margin-bottom: 15px; color: #ddd; }
.device-grid { display: flex; gap: 20px; margin-bottom: 40px; }

.device-card { 
    width: 150px; height: 150px; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; cursor: pointer; user-select: none;
}
.device-card:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.15); }
.device-card .icon { font-size: 3rem; margin-bottom: 10px; }
.device-card h4 { font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; }
.device-card .status-text { font-size: 0.8rem; background: rgba(255,255,255,0.1); padding: 4px 10px; border-radius: 12px; color: #bbb;}

/* AÇIK (SARI) DURUMU (Lambalar için) */
.device-card.active {
    background: rgba(200, 180, 50, 0.4);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}
.device-card.active .status-text { background: rgba(255, 215, 0, 0.3); color: #fff; }

/* KAPI AÇIK (KIRMIZI) DURUMU */
.device-card.door-open {
    background: rgba(255, 71, 87, 0.4);
    border-color: rgba(255, 71, 87, 0.6);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.2);
    transform: scale(0.95);
}
.device-card.door-open .status-text { background: rgba(255, 71, 87, 0.6); color: #fff; }

.device-card.inactive { opacity: 0.6; cursor: not-allowed; }
.device-card.inactive:hover { transform: none; }

.leave-btn {
    position: absolute; bottom: 40px; right: 40px;
    background: #ff4757; color: white; border: none;
    padding: 15px 30px; border-radius: 30px; font-size: 1.1rem;
    font-weight: bold; cursor: pointer; box-shadow: 0 10px 20px rgba(255, 71, 87, 0.3);
    transition: all 0.3s ease;
}
.leave-btn:hover { background: #ff6b81; transform: scale(1.05); }

/* --- KAMERA BUTONU VE ARAYÜZÜ --- */

/* Sol Alt Kamera Butonu */
.camera-btn {
    position: absolute; bottom: 40px; left: 40px;
    background: #3498db; color: white; border: none;
    padding: 15px 30px; border-radius: 30px; font-size: 1.1rem;
    font-weight: bold; cursor: pointer; box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}
.camera-btn:hover { background: #2980b9; transform: scale(1.05); }

/* Kamera Tam Ekran Arka Planı */
.camera-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; /* En üstte görünmesi için */
    opacity: 1; transition: opacity 0.3s ease;
}

/* Kamera Kutusu */
.camera-container {
    width: 80%; max-width: 900px;
    text-align: center;
    background: rgba(30, 40, 60, 0.8);
}

/* Kamera Yayın Görüntüsü */
#camera-stream {
    width: 100%;
    border-radius: 10px;
    border: 2px solid #3498db;
    background: #000;
    min-height: 400px;
    object-fit: cover;
}

/* Gizleme Sınıfı */
.hidden {
    opacity: 0;
    pointer-events: none;
}