/* ============================================================
   style.css - استایل‌های اصلی پروژه با تم شیشه‌ای
   ============================================================ */

/* ===== تنظیمات کلی ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: url('http://daco-iot.ir/background.webp') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    color: #e8edf5;
    padding: 0;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 0;
}

.container,
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* ===== کلاس‌های شیشه‌ای ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 1.2rem !important;
    transition: all 0.3s !important;
    color: #e8edf5 !important;
}

.glass-card:hover {
    border-color: rgba(102, 126, 234, 0.2) !important;
}

.glass-card .card-title {
    color: rgba(255, 255, 255, 0.6) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    margin-bottom: 0.8rem !important;
}

.glass-card .card-title i {
    color: rgba(102, 126, 234, 0.5) !important;
    margin-left: 6px !important;
}

/* ===== جدول شیشه‌ای ===== */
.table-glass {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(180%) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    width: 100% !important;
    color: #e8edf5 !important;
}

.table-glass thead {
    background: rgba(255, 255, 255, 0.04) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.table-glass th {
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.7rem 0.8rem !important;
    border: none !important;
    text-align: center !important;
}

.table-glass td {
    color: rgba(255, 255, 255, 0.75) !important;
    padding: 0.6rem 0.8rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    font-size: 0.85rem !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.table-glass tr:hover td {
    background: rgba(255, 255, 255, 0.04) !important;
}

.table-glass tbody tr:last-child td {
    border-bottom: none !important;
}

/* ===== جدول شیشه‌ای قهوه‌ای ===== */
.table-glass-brown {
    background: rgba(60, 40, 20, 0.2) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(139, 90, 43, 0.12) !important;
    width: 100% !important;
    color: #e8edf5 !important;
}

.table-glass-brown thead {
    background: rgba(139, 90, 43, 0.15) !important;
    border-bottom: 1px solid rgba(139, 90, 43, 0.06) !important;
}

.table-glass-brown th {
    color: rgba(255, 220, 180, 0.6) !important;
    font-weight: 600 !important;
    font-size: 0.65rem !important;
    padding: 0.5rem 0.6rem !important;
    border: none !important;
    text-align: center !important;
}

.table-glass-brown td {
    color: rgba(255, 220, 180, 0.75) !important;
    padding: 0.4rem 0.6rem !important;
    border-bottom: 1px solid rgba(139, 90, 43, 0.04) !important;
    font-size: 0.75rem !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.table-glass-brown tr:hover td {
    background: rgba(139, 90, 43, 0.05) !important;
}

.table-glass-brown tbody tr:last-child td {
    border-bottom: none !important;
}

/* ===== لیست شیشه‌ای ===== */
.list-glass {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(180%) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 0.5rem !important;
}

.list-glass .list-group-item {
    background: rgba(255, 255, 255, 0.02) !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    color: rgba(255, 255, 255, 0.75) !important;
    padding: 0.7rem 1rem !important;
}

.list-glass .list-group-item:last-child {
    border-bottom: none !important;
}

.list-glass .list-group-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* ===== نوار بالا ===== */
.navbar-glass {
    background: rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(18px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(200%) !important;
    border-radius: 24px !important;
    padding: 0.8rem 1.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 1.5rem !important;
}

.navbar-glass .brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.navbar-glass .brand img {
    height: 45px;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
}

.navbar-glass .brand span {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-glass .brand small {
    font-weight: 400;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    display: block;
    margin-top: -2px;
}

/* ===== دکمه‌ها ===== */
.btn-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 50px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 0.4rem 1.2rem !important;
    transition: all 0.3s !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-family: inherit !important;
    cursor: pointer !important;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

.btn-glass-danger {
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: rgba(239, 68, 68, 0.7) !important;
}

.btn-glass-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

/* ===== کارت‌های آماری ===== */
.stat-card {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(14px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
    border-radius: 20px !important;
    padding: 1.2rem !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: 20px;
}

.stat-card:hover {
    transform: translateY(-6px);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-icon {
    font-size: 1.8rem;
    color: rgba(102, 126, 234, 0.7);
    margin-bottom: 0.3rem;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 400;
}

/* ===== اقدامات سریع ===== */
.quick-action {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.quick-action .btn-action {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 0.8rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-size: 0.9rem;
    flex: 1 1 auto;
    min-width: 120px;
    justify-content: center;
}

.quick-action .btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

.quick-action .btn-action i {
    font-size: 1.2rem;
    color: rgba(102, 126, 234, 0.5);
}

/* ===== گیج‌ها ===== */
.gauge-wrapper {
    position: relative;
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1/1;
    margin: 0 auto;
}

.gauge-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.gauge-label {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    margin-top: 0.2rem;
}

.gauge-value {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: -0.2rem;
}

.gauge-value.temp-value {
    color: #fbbf24;
}
.gauge-value.humid-value {
    color: #38bdf8;
}
.gauge-value.battery-value {
    color: #34d399;
}

/* ===== وضعیت درب ===== */
.door-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

.door-closed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.door-open {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== وضعیت زنده ===== */
.live-badge {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ===== فرم‌ها ===== */
.form-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    padding: 0.6rem 1rem !important;
    color: #fff !important;
    font-family: inherit !important;
    width: 100% !important;
    transition: all 0.3s !important;
    font-size: 0.9rem !important;
}

.form-glass:focus {
    outline: none !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.05) !important;
}

.form-glass::placeholder {
    color: rgba(255, 255, 255, 0.2) !important;
}

.form-glass option {
    background: #1a2338 !important;
    color: #fff !important;
}

/* ===== دکمه‌های پمپ ===== */
.pump-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    min-width: 80px;
}

.pump-btn-on {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.pump-btn-off {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.pump-btn-on:hover {
    background: rgba(16, 185, 129, 0.35);
}
.pump-btn-off:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ===== اسکرول ===== */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 10px;
}

/* ===== انیمیشن شمارش ===== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.stat-number {
    animation: countUp 0.6s ease forwards;
}

/* ===== واکنش‌گرایی ===== */
@media (max-width: 768px) {
    .container,
    .app-container {
        padding: 0.5rem;
    }
    .navbar-glass {
        padding: 0.6rem 1rem;
        border-radius: 18px;
    }
    .navbar-glass .brand span {
        font-size: 1rem;
    }
    .navbar-glass .brand img {
        height: 32px;
    }
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    .stat-card .stat-icon {
        font-size: 1.4rem;
    }
    .quick-action .btn-action {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
    .gauge-wrapper {
        max-width: 140px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0.3rem;
    }
    .stat-card {
        padding: 0.8rem !important;
    }
    .stat-card .stat-number {
        font-size: 1.2rem;
    }
    .navbar-glass .brand span {
        font-size: 0.9rem;
    }
    .quick-action .btn-action {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        min-width: 60px;
    }
    .quick-action .btn-action i {
        font-size: 1rem;
    }
    .gauge-wrapper {
        max-width: 110px;
    }
    .gauge-value {
        font-size: 1rem;
    }
}