/* =============================================
   RESET & BASE
   ============================================= */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px; /* پایه برای استفاده از rem */
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'B YEKAN', 'Segoe UI', 'Poppins', system-ui, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh; /* برای مرورگرهای جدید */
    overflow-x: hidden;
    background: none;
    position: relative;
    font-size: 1rem;
    line-height: 1.5;
    transition: background-color 0.25s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   VARIABLES (Light & Dark)
   ============================================= */
:root {
    --bg-body: transparent;
    --text-primary: #1a2c3e;
    --text-secondary: #2d3f52;

    --sidebar-bg: rgba(255, 255, 255, 0.40);
    --sidebar-border: rgba(255, 255, 255, 0.50);
    --card-bg: rgba(255, 255, 255, 0.35);
    --card-border: rgba(255, 255, 255, 0.45);
    --glass-bg: rgba(255, 255, 255, 0.30);
    --badge-bg: rgba(255, 255, 255, 0.40);
    --hover-bg: rgba(255, 255, 255, 0.50);
    --input-bg: rgba(255, 255, 255, 0.40);
    --input-border: rgba(255, 255, 255, 0.60);
    --modal-gradient-start: rgba(255, 255, 255, 0.50);
    --modal-gradient-end: rgba(255, 255, 255, 0.20);
    --modal-border: rgba(255, 255, 255, 0.40);
    --border-light: rgba(255, 255, 255, 0.30);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --toast-bg: rgba(15, 23, 42, 0.4);
    --topbar-bg: rgba(255, 255, 255, 0.25);
    --primary-color: #2b98ff;

    --btn-glass-bg: rgba(255, 255, 255, 0.35);
    --btn-glass-border: rgba(255, 255, 255, 0.50);
    --btn-glass-text: #1a2c3e;
    --btn-glass-shadow: rgba(43, 152, 255, 0.05);
    --glass-primary-bg: rgba(43, 152, 255, 0.40);
    --glass-danger-bg: rgba(225, 29, 72, 0.35);
    --glass-warning-bg: rgba(230, 126, 34, 0.35);

    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    --alarm-default: #2b98ff;
    --alarm-warning: #eab308;
    --alarm-critical: #e11d48;
}

body.dark {
    --text-primary: #F3F3F3;
    --text-secondary: #cbd5e1;

    --sidebar-bg: rgba(20, 25, 35, 0.15);
    --sidebar-border: rgba(255, 255, 255, 0.04);
    --card-bg: rgba(20, 25, 35, 0.12);
    --card-border: rgba(255, 255, 255, 0.03);
    --glass-bg: rgba(20, 25, 35, 0.08);
    --badge-bg: rgba(255, 255, 255, 0.03);
    --hover-bg: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(20, 25, 35, 0.20);
    --input-border: rgba(255, 255, 255, 0.06);
    --modal-gradient-start: rgba(20, 25, 35, 0.30);
    --modal-gradient-end: rgba(20, 25, 35, 0.10);
    --modal-border: rgba(255, 255, 255, 0.04);
    --border-light: rgba(255, 255, 255, 0.03);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --toast-bg: rgba(10, 12, 18, 0.6);
    --topbar-bg: rgba(20, 25, 35, 0.08);
    --btn-glass-bg: rgba(20, 25, 35, 0.30);
    --btn-glass-border: rgba(255, 255, 255, 0.06);
    --btn-glass-text: #F3F3F3;
    --glass-primary-bg: rgba(43, 152, 255, 0.15);
    --glass-danger-bg: rgba(225, 29, 72, 0.12);
    --glass-warning-bg: rgba(230, 126, 34, 0.12);
    background-color: #0a0c12;
}

/* =============================================
   BACKGROUND IMAGES (fixed with blur)
   ============================================= */
   body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Light6.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    z-index: -1;
    pointer-events: none;
}

body.dark::before {
    background-image: url('Dark3.jpg');
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
.main-content {
    transition: margin-right 0.3s ease-out;
    padding: 40px 16px 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
}

/* =============================================
   TOP BAR
   ============================================= */
.top-bar {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.global-header {
    background: var(--card-bg);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.global-header .header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
}

.global-header .header-left .menu-logo {
    height: 53px;
    width: 53px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: none !important;
    box-shadow: none;
    border: none;
}

.global-header .header-left .header-title-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    min-width: 0;
}

.global-header .header-left .header-title-group .main-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.global-header .header-left .header-title-group .sub-title {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0.8;
    white-space: nowrap;
}

.global-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tab-bar {
    background: var(--card-bg);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    justify-content: center;
}

.tab-bar .tab-btn {
    background: var(--btn-glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--btn-glass-border);
    border-radius: 32px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    color: var(--btn-glass-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.tab-bar .tab-btn.active {
    background: var(--glass-primary-bg) !important;
    backdrop-filter: blur(20px) saturate(200%) !important;
    color: var(--text-primary) !important;
    border-color: rgba(43, 152, 255, 0.30) !important;
    box-shadow: 0 4px 16px rgba(43, 152, 255, 0.08);
}

.tab-bar .tab-btn:hover:not(.active) {
    background: var(--hover-bg);
    transform: translateY(-1px);
}

/* =============================================
   SIDEBAR
   ============================================= */
   .sidebar {
    position: fixed;
    top: 40px;
    bottom: 20px;          /* ← فاصله ثابت از پایین در حالت عادی */
    right: -320px;
    width: 85%;
    max-width: 280px;
    height: calc(100vh - 40px - 20px);  /* ← ارتفاع = کل صفحه منهای فاصله بالا و پایین */
    background: var(--sidebar-bg);
    backdrop-filter: blur(48px) saturate(200%);
    -webkit-backdrop-filter: blur(48px) saturate(200%);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.08);
    z-index: 1200;
    transition: right 0.3s ease-out;
    border-left: 1px solid var(--sidebar-border);
    border-radius: 30px;
    padding: 16px 0 0 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}
.sidebar.open {
    right: 10px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: none;
    flex-shrink: 0;
    padding-left: calc(16px + var(--safe-area-left));
    padding-right: calc(16px + var(--safe-area-right));
}

.sidebar-header h3 {
    color: var(--text-primary) !important;
    font-weight: normal !important; /* ← بولد نباشه */
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h3 .logo-sidebar {
    height: 40px;
    width: 40px;
    border-radius: 50%; /* ← گرد شد */
    background: none !important;
    box-shadow: none;
    border: none;
    object-fit: cover;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.sidebar-scrollable {
    overflow-y: auto;
    min-height: 0;
    padding: 0 4px 160px 4px;
    height: 100%;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.bottom-sidebar-actions {
    background: transparent;
    backdrop-filter: none;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: none;
    flex-shrink: 0;
    z-index: 5;
}

/* =============================================
   SIDEBAR BUTTONS (glassmorphism)
   ============================================= */
/* =============================================
   SIDEBAR BUTTONS (glassmorphism) - یکدست شده
   ============================================= */
   .dashboard-alarm-row,
.add-support-row,
.settings-row {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
}

/* همه دکمه‌های متنی در سایدبار - یکدست کامل */
.new-dashboard-btn,
.add-device-btn,
.settings-row .settings-btn {
    flex: 1;
    text-align: center;
    padding: 0 8px;
    height: 40px;
    line-height: 40px;
    border-radius: 32px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    font-size: 0.8rem;
    background: var(--btn-glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--btn-glass-border) !important;
    color: var(--btn-glass-text) !important;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    box-sizing: border-box;
}

/* دکمه‌های گرد */
.alarm-btn,
.support-btn,
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.2s;
    flex-shrink: 0;
    background: var(--btn-glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--btn-glass-border) !important;
    box-shadow: var(--shadow);
    box-sizing: border-box;
}

.alarm-btn { color: var(--alarm-default); }
.alarm-btn.warning { color: var(--alarm-warning); background: rgba(234, 179, 8, 0.12) !important; border-color: rgba(234, 179, 8, 0.25) !important; }
.alarm-btn.critical { color: var(--alarm-critical); background: rgba(225, 29, 72, 0.12) !important; border-color: rgba(225, 29, 72, 0.25) !important; animation: shake 0.6s infinite; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.alarm-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: ltr;
    box-shadow: 0 0 0 2px var(--card-bg);
}

.settings-row .settings-btn.update-alert {
    background: var(--glass-danger-bg) !important;
    border-color: rgba(225, 29, 72, 0.30) !important;
    color: #e11d48 !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* =============================================
   COLLAPSIBLE SECTIONS
   ============================================= */
.collapsible-section {
    margin: 0 12px 12px 12px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 6px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header h4 {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.section-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-top: 8px;
}

.section-content.collapsed {
    max-height: 0;
}

.empty-message {
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: center;
}

/* =============================================
   DASHBOARD & DEVICE ITEMS
   ============================================= */
.dashboard-item,
.device-item {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-radius: 20px;
    margin: 6px 0;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.dashboard-item {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.dashboard-item:hover {
    background: var(--hover-bg);
    transform: translateX(-2px);
}

.dashboard-name {
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.delete-dashboard {
    background: var(--glass-danger-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(225, 29, 72, 0.15);
    border-radius: 50%;
    color: #e11d48;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.delete-dashboard:hover {
    background: rgba(225, 29, 72, 0.20);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.device-header i {
    color: var(--primary-color);
    margin-left: 8px;
}

.status-badge {
    font-size: 0.6rem;
    background: var(--badge-bg);
    backdrop-filter: blur(8px);
    padding: 2px 8px;
    border-radius: 20px;
}

.online { color: #10b981; }
.offline { color: #ef4444; }

.device-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: transparent;
}

.device-submenu.show {
    max-height: 500px;
    overflow-y: auto;
}

.device-submenu li {
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border-light);
    cursor: pointer;
    transition: 0.1s;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.device-submenu li:hover {
    background: var(--hover-bg);
    padding-right: 28px;
}

.device-submenu li.delete-device-tab {
    color: #ef4444;
}
.device-submenu li.delete-device-tab i {
    color: #ef4444;
}

/* =============================================
   GRID CARDS (Relay & Scenario)
   ============================================= */
.relay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    width: 100%;
    margin-top: 20px;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 14px;
    width: 100%;
    margin-top: 20px;
}

.relay-card,
.scenario-card {
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(32px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
    border-radius: 28px;
    padding: 18px 10px 14px;
    text-align: center;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    will-change: transform, box-shadow;
}

.relay-card:hover,
.scenario-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.relay-card.on,
.scenario-card.on {
    background: rgba(35, 166, 255, 0.85) !important;
    backdrop-filter: blur(100px) saturate(220%) !important;
    border: 1px solid rgba(35, 166, 255, 0.5) !important;
    box-shadow:
        0 4px 24px rgba(35, 166, 255, 0.2),
        inset 0 0 0 1px rgba(35, 166, 255, 0.3) !important;
}

.relay-card.on:hover,
.scenario-card.on:hover {
    background: rgba(35, 166, 255, 0.9) !important;
    box-shadow:
        0 8px 32px rgba(35, 166, 255, 0.3),
        inset 0 0 0 1px rgba(35, 166, 255, 0.4) !important;
}

body.dark .relay-card,
body.dark .scenario-card {
    background: rgba(20, 25, 35, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

body.dark .relay-card:hover,
body.dark .scenario-card:hover {
    background: rgba(20, 25, 35, 0.35) !important;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.dark .relay-card.on,
body.dark .scenario-card.on {
    background: rgba(35, 166, 255, 0.7) !important;
    border: 1px solid rgba(35, 166, 255, 0.4) !important;
    box-shadow:
        0 4px 24px rgba(35, 166, 255, 0.15),
        inset 0 0 0 1px rgba(35, 166, 255, 0.2) !important;
}

body.dark .relay-card.on:hover,
body.dark .scenario-card.on:hover {
    background: rgba(35, 166, 255, 0.8) !important;
    box-shadow:
        0 8px 32px rgba(35, 166, 255, 0.25),
        inset 0 0 0 1px rgba(35, 166, 255, 0.3) !important;
}

/* Emoji */
.relay-emoji,
.scenario-emoji {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(180, 180, 180, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin: 0 auto 8px auto;
    font-size: 2rem;
    line-height: 1;
    transition: background 0.3s, transform 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(180, 180, 180, 0.08);
}

.relay-card:hover .relay-emoji,
.scenario-card:hover .scenario-emoji {
    transform: scale(1.1);
}

body.dark .relay-emoji,
body.dark .scenario-emoji {
    background: rgba(140, 140, 140, 0.08);
    border-color: rgba(140, 140, 140, 0.05);
}

.relay-card.on .relay-emoji,
.scenario-card.on .relay-emoji {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(43, 152, 255, 0.25);
    box-shadow: 0 0 24px rgba(43, 152, 255, 0.10);
}

body.dark .relay-card.on .relay-emoji,
body.dark .scenario-card.on .relay-emoji {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(43, 152, 255, 0.20);
    box-shadow: 0 0 24px rgba(43, 152, 255, 0.06);
}

.relay-name,
.scenario-name {
    font-weight: 700;
    font-size: 0.9rem;
    word-break: break-word;
    max-width: 100%;
    margin-top: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.relay-card.on .relay-name,
.scenario-card.on .scenario-name,
.relay-card.on .scenario-number,
.scenario-card.on .scenario-number {
    color: var(--text-primary) !important;
    text-shadow: 0 1px 4px rgba(43, 152, 255, 0.10);
}

body.dark .relay-card.on .relay-name,
body.dark .scenario-card.on .scenario-name {
    color: #F3F3F3 !important;
}

/* Edit icon */
.edit-icon {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s, background 0.2s, transform 0.2s;
    font-size: 0.75rem;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.relay-card:hover .edit-icon,
.scenario-card:hover .edit-icon {
    opacity: 0.85;
}

.edit-icon:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Shimmer effect for ON state */
/* =============================================
   شاینر حرفه‌ای برای کارت‌های روشن
   ============================================= */
/* =============================================
   شاینر حرفه‌ای برای کارت‌های روشن (سرعت کمتر و opacity کمتر)
   ============================================= */
   .relay-card.on::before,
   .scenario-card.on::before {
       content: '';
       position: absolute;
       inset: 0;
       background: linear-gradient(105deg, 
           transparent 35%, 
           rgba(255, 255, 255, 0.2) 45%, 
           rgba(255, 255, 255, 0.45) 50%, 
           rgba(255, 255, 255, 0.2) 55%, 
           transparent 65%
       );
       background-size: 300% 100%;
       animation: shimmerSlide 5s ease-in-out infinite;
       pointer-events: none;
       border-radius: 28px;
       z-index: 1;
       filter: blur(0.8px);
   }
   
   /* نسخه مخصوص حالت تاریک */
   body.dark .relay-card.on::before,
   body.dark .scenario-card.on::before {
       background: linear-gradient(105deg, 
           transparent 35%, 
           rgba(255, 255, 255, 0.1) 45%, 
           rgba(255, 255, 255, 0.3) 50%, 
           rgba(255, 255, 255, 0.1) 55%, 
           transparent 65%
       );
       background-size: 300% 100%;
   }
   
   /* انیمیشن حرکت شاینر */
   @keyframes shimmerSlide {
       0% { background-position: -200% center; }
       100% { background-position: 200% center; }
   }
   
   /* سایه‌ی درخشان دور کارت در حالت روشن */
   /* =============================================
   شاینر حرفه‌ای برای کارت‌های روشن
   ============================================= */
/* =============================================
   شاینر حرفه‌ای برای کارت‌های روشن (سرعت ۶۰٪ کمتر)
   ============================================= */
   /* =============================================
   شاینر حرفه‌ای برای کارت‌های روشن (حرکت یکنواخت کامل)
   ============================================= */
.relay-card.on::before,
.scenario-card.on::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, 
        transparent 35%, 
        rgba(255, 255, 255, 0.2) 45%, 
        rgba(255, 255, 255, 0.45) 50%, 
        rgba(255, 255, 255, 0.2) 55%, 
        transparent 65%
    );
    background-size: 400% 100%;
    animation: shimmerSlide 12.5s linear infinite;
    pointer-events: none;
    border-radius: 28px;
    z-index: 1;
    filter: blur(0.8px);
}

/* نسخه مخصوص حالت تاریک */
body.dark .relay-card.on::before,
body.dark .scenario-card.on::before {
    background: linear-gradient(105deg, 
        transparent 35%, 
        rgba(255, 255, 255, 0.1) 45%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0.1) 55%, 
        transparent 65%
    );
    background-size: 400% 100%;
}

/* انیمیشن حرکت شاینر - یکنواخت و کامل */
@keyframes shimmerSlide {
    0% { background-position: -300% center; }
    100% { background-position: 100% center; }
}

/* سایه‌ی درخشان دور کارت در حالت روشن */
.relay-card.on,
.scenario-card.on {
    box-shadow: 
        0 0 30px rgba(43, 152, 255, 0.3),
        0 8px 32px rgba(43, 152, 255, 0.15),
        inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
    transition: box-shadow 0.4s ease;
}

body.dark .relay-card.on,
body.dark .scenario-card.on {
    box-shadow: 
        0 0 40px rgba(43, 152, 255, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.05) !important;
}

/* ===== انیمیشن‌های دیگر (پاپ و سناریو) ===== */
@keyframes popEmoji {
    0% { transform: scale(1); }
    40% { transform: scale(1.8); }
    100% { transform: scale(1); }
}
.relay-emoji.pop { animation: popEmoji 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

.scenario-card.running {
    animation: scenarioRun 0.6s ease;
}
@keyframes scenarioRun {
    0% { transform: scale(1); background: rgba(35, 166, 255, 0.05); }
    20% { transform: scale(1.05); background: rgba(35, 166, 255, 0.4); }
    45% { transform: scale(1.10); background: rgba(35, 166, 255, 0.7); }
    75% { transform: scale(1.03); background: rgba(35, 166, 255, 0.4); }
    90% { transform: scale(1); background: rgba(35, 166, 255, 0.15); }
    100% { transform: scale(1); background: rgba(35, 166, 255, 0); }
}
/* =============================================
   MODALS
   ============================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: linear-gradient(145deg, var(--modal-gradient-start) 0%, var(--modal-gradient-end) 100%);
    backdrop-filter: blur(48px) saturate(200%);
    -webkit-backdrop-filter: blur(48px) saturate(200%);
    border-radius: 36px;
    padding: 20px 20px;
    width: 100%;
    max-width: 500px;
    direction: rtl;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.10);
    border: 1px solid var(--modal-border);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    color: var(--text-primary);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-group-modal {
    margin-bottom: 15px;
}
.form-group-modal label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.form-group-modal input,
.form-group-modal select {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--input-border);
    border-radius: 24px;
    font-size: 0.9rem;
    transition: all 0.2s;
    outline: none;
    color: var(--text-primary);
}
.form-group-modal input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 4px 8px;
}
.form-group-modal input:focus,
.form-group-modal select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 152, 255, 0.08);
}

.color-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}
.color-row .form-group-modal {
    flex: 1;
    margin-bottom: 0;
}

.default-color-btn {
    background: var(--btn-glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--btn-glass-border);
    border-radius: 24px;
    padding: 8px 12px;
    color: var(--btn-glass-text);
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 8px;
    width: 100%;
    transition: 0.2s;
}
.default-color-btn:hover {
    background: var(--hover-bg);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.modal-buttons button {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 32px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 80px;
}

.save-btn-modal {
    background: var(--glass-primary-bg) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(43, 152, 255, 0.20) !important;
    color: var(--text-primary) !important;
}
.save-btn-modal:hover {
    background: rgba(43, 152, 255, 0.20) !important;
    transform: translateY(-2px);
}

.cancel-btn-modal {
    background: var(--btn-glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--btn-glass-border) !important;
    color: var(--btn-glass-text) !important;
}
.cancel-btn-modal:hover {
    background: var(--hover-bg) !important;
}

/* =============================================
   GLASS CARD (general)
   ============================================= */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border-radius: 22px;
    padding: 16px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    width: 100%;
    overflow-x: auto;
}

/* =============================================
   BUTTONS (general)
   ============================================= */
button, .mgmt-btn {
    background: var(--btn-glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--btn-glass-border) !important;
    color: var(--btn-glass-text) !important;
    box-shadow: var(--shadow);
    border-radius: 32px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.15s;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

button:hover, .mgmt-btn:hover {
    background: var(--hover-bg) !important;
    transform: translateY(-2px);
}

.mgmt-btn {
    width: 100%;
    margin: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: right;
    line-height: 1.4;
    padding: 12px 16px;
    white-space: normal;
    word-break: break-word;
    position: relative;
}

.mgmt-btn .btn-icon {
    font-size: 1.1rem;
    margin-left: 8px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.mgmt-btn .btn-title {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 4px;
    padding-right: 28px;
}
.mgmt-btn .btn-desc {
    font-size: 0.7rem;
    opacity: 0.9;
    font-weight: normal;
    padding-right: 28px;
}

.mgmt-btn.danger {
    background: var(--glass-danger-bg) !important;
    border-color: rgba(225, 29, 72, 0.20) !important;
    color: #e11d48 !important;
}
.mgmt-btn.danger:hover {
    background: rgba(225, 29, 72, 0.20) !important;
}
.mgmt-btn.warning {
    background: var(--glass-warning-bg) !important;
    border-color: rgba(230, 126, 34, 0.20) !important;
    color: #e67e22 !important;
}
.mgmt-btn.warning:hover {
    background: rgba(230, 126, 34, 0.20) !important;
}
.mgmt-btn.secondary {
    background: var(--btn-glass-bg) !important;
    border-color: var(--btn-glass-border) !important;
    color: var(--btn-glass-text) !important;
}

/* =============================================
   LOGS
   ============================================= */
.log-entry {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 10px 14px;
    margin: 10px 0;
    border-right: 3px solid var(--primary-color);
    word-break: break-word;
    font-size: 0.85rem;
    border: 1px solid var(--card-border);
}

/* =============================================
   INPUTS
   ============================================= */
input, select {
    background: var(--input-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--input-border);
    border-radius: 24px;
    padding: 8px 12px;
    width: 100%;
    margin: 6px 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* =============================================
   TOAST
   ============================================= */
.toast {
    position: fixed;
    bottom: 16px;
    left: 16px;
    background: var(--toast-bg);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 32px;
    font-size: 0.8rem;
    z-index: 1300;
    max-width: calc(100% - 32px);
    word-break: break-word;
    border: 1px solid var(--card-border);
}

/* =============================================
   MISC
   ============================================= */
.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.schedule-item {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 12px;
    margin: 10px 0;
    border-right: 4px solid var(--primary-color);
    position: relative;
    word-break: break-word;
    font-size: 0.85rem;
    border: 1px solid var(--card-border);
}

.schedule-delete-btn {
    background: var(--glass-danger-bg) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(225, 29, 72, 0.15) !important;
    border-radius: 24px;
    padding: 4px 10px;
    color: #e11d48 !important;
    cursor: pointer;
    margin-top: 8px;
    font-size: 0.75rem;
}
.schedule-delete-btn:hover {
    background: rgba(225, 29, 72, 0.15) !important;
}

.refresh-schedules-btn {
    background: var(--btn-glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--btn-glass-border);
    border-radius: 24px;
    padding: 4px 12px;
    color: var(--btn-glass-text);
    cursor: pointer;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.refresh-schedules-btn:hover {
    background: var(--hover-bg);
}

.device-select-card {
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 20px 16px;
    transition: 0.2s;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
}

.layout-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.layout-btn {
    background: var(--btn-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--btn-glass-border);
    border-radius: 24px;
    padding: 6px 14px;
    color: var(--btn-glass-text);
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
}
.layout-btn:hover {
    background: var(--hover-bg);
}
.layout-btn.secondary {
    background: var(--input-bg);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-right: none;
    padding-right: 0;
}
.dashboard-header h1 { display: none; }

.draggable .relay-card,
.draggable .scenario-card {
    cursor: grab;
}
.draggable .relay-card:active,
.draggable .scenario-card:active {
    cursor: grabbing;
}

.dashboard-checkboxes-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.dashboard-checkboxes-vertical label {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
}
.dashboard-checkboxes-vertical label input { margin: 0; order: 1; }
.dashboard-checkboxes-vertical label span { order: 0; }

.device-list-item {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    margin: 8px 0;
    border: 1px solid var(--card-border);
    overflow: hidden;
}
.device-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    background: transparent;
    color: var(--text-primary);
}
.device-items-list {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: transparent;
}
.device-items-list.show {
    max-height: 300px;
    overflow-y: auto;
}
.device-items-list li {
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border-light);
    cursor: pointer;
}
.device-items-list li input { width: auto; margin: 0; }

.scenario-settings-modal-content,
.advanced-modal-content { text-align: center; }
.scenario-settings-modal-content p,
.advanced-modal-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
}
.warning-icon {
    font-size: 2rem;
    color: #f59e0b;
    margin-bottom: 10px;
    text-align: center;
}

.all-relays-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}
.all-relays-btn {
    background: var(--btn-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--btn-glass-border);
    border-radius: 32px;
    padding: 8px 20px;
    color: var(--btn-glass-text);
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
    flex: 1;
    max-width: 180px;
}
.all-relays-btn.off { background: var(--input-bg); }
.all-relays-btn:hover {
    transform: translateY(-2px);
    background: var(--hover-bg);
}

.help-card {
    background: var(--glass-bg);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border-radius: 22px;
    padding: 16px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    margin-top: 20px;
}
.help-card h3 {
    font-size: 1rem;
    text-align: center;
    margin-bottom: 12px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}
.help-card p {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 12px;
    text-align: justify;
}
.help-card .support-btn-inline {
    background: var(--btn-glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--btn-glass-border);
    border-radius: 32px;
    padding: 8px 16px;
    color: var(--btn-glass-text);
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
    display: inline-block;
    margin-top: 8px;
}
.help-card .support-btn-inline:hover {
    transform: translateY(-2px);
    background: var(--hover-bg);
}

.advanced-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}
.advanced-checkbox-row input { width: auto; margin: 0; }

.client-id-display {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.4;
    word-break: break-all;
    direction: ltr;
    font-family: monospace;
}

/* =============================================
   QR & SCANNER
   ============================================= */
.qr-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
.video-preview {
    width: 100%;
    max-width: 320px;
    border-radius: 20px;
    margin: 0 auto;
    display: block;
}
.scan-result {
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
}

/* =============================================
   VERSION & UPDATE
   ============================================= */
.version-text {
    opacity: 0.4;
    text-align: center;
    margin-top: 20px;
    font-size: 0.75rem;
    direction: ltr;
}

.update-warning {
    background: var(--glass-warning-bg);
    backdrop-filter: blur(16px);
    color: #e67e22;
    padding: 8px 12px;
    border-radius: 20px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.8rem;
    border: 1px solid rgba(230, 126, 34, 0.10);
}
.download-update-btn {
    background: var(--glass-primary-bg) !important;
    border-color: rgba(43, 152, 255, 0.15) !important;
    color: var(--text-primary) !important;
    margin-top: 6px;
}
.download-update-btn:hover {
    background: rgba(43, 152, 255, 0.15) !important;
}

/* =============================================
   USER PERMISSIONS
   ============================================= */
.user-perm-detail {
    font-size: 0.75rem;
    background: var(--badge-bg);
    backdrop-filter: blur(12px);
    padding: 6px 8px;
    border-radius: 16px;
    margin-top: 4px;
}
.perm-badge {
    display: inline-block;
    background: var(--card-border);
    padding: 2px 8px;
    border-radius: 20px;
    margin: 2px;
    font-size: 0.7rem;
}
.perm-badge i { margin-left: 3px; }

/* =============================================
   NEWS
   ============================================= */
.news-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-radius: 24px;
    padding: 14px 16px;
    margin: 12px 0;
    border-right: 6px solid;
    box-shadow: var(--shadow);
    transition: 0.2s;
    border: 1px solid var(--card-border);
}
.news-card.critical { border-right-color: #e11d48; background: rgba(225, 29, 72, 0.04); }
.news-card.high { border-right-color: #f97316; background: rgba(249, 115, 22, 0.04); }
.news-card.normal { border-right-color: var(--primary-color); background: rgba(43, 152, 255, 0.03); }
.news-card.low { border-right-color: #6b7280; background: rgba(107, 114, 128, 0.03); }

.news-card .news-title {
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.news-card .news-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}
.news-card .news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.news-card .news-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    direction: ltr;
}
.news-card .news-buttons {
    display: flex;
    gap: 8px;
}
.news-card .news-link-btn,
.news-card .mark-read-btn {
    background: var(--btn-glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--btn-glass-border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
    color: var(--btn-glass-text);
}
.news-card .news-link-btn:hover,
.news-card .mark-read-btn:hover {
    background: var(--hover-bg);
}
.news-card .mark-read-btn.marked {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
}
.empty-news {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* =============================================
   SOCIAL
   ============================================= */
.social-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}
.social-btn {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 12px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-primary);
    text-decoration: none;
    width: 100%;
    max-width: 280px;
    text-align: center;
}
.social-btn i { font-size: 1.2rem; }
.social-btn:hover {
    transform: translateY(-2px);
    background: var(--hover-bg);
    border-color: var(--primary-color);
}
.email-text {
    text-align: center;
    font-size: 1rem;
    background: var(--badge-bg);
    backdrop-filter: blur(16px);
    padding: 10px;
    border-radius: 32px;
    margin-top: 20px;
    word-break: break-all;
    font-family: monospace;
    border: 1px solid var(--card-border);
}
.support-description {
    text-align: center;
    margin: 10px 0 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--badge-bg);
    backdrop-filter: blur(16px);
    padding: 8px 12px;
    border-radius: 24px;
}

/* =============================================
   PASSCODE LOCK
   ============================================= */
.passcode-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}
.passcode-box {
    background: var(--card-bg);
    backdrop-filter: blur(48px) saturate(200%);
    -webkit-backdrop-filter: blur(48px) saturate(200%);
    border-radius: 32px;
    padding: 30px 20px;
    text-align: center;
    width: 280px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.10);
    border: 1px solid var(--card-border);
}
.passcode-box .logo-passcode {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 50%;
    background: transparent !important;
    box-shadow: none;
    margin-bottom: 16px;
}
.passcode-box .logo-passcode:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(43, 152, 255, 0.15), 0 0 60px rgba(43, 152, 255, 0.05);
}
.passcode-box input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 8px;
    direction: ltr;
}
.passcode-box button { margin-top: 16px; width: 100%; }

/* =============================================
   TOGGLE CHECKBOX / RADIO
   ============================================= */
.toggle-checkbox,
.toggle-radio,
.days-check-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--input-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--input-border);
    border-radius: 32px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: 0.2s;
    user-select: none;
    gap: 4px;
}
.toggle-checkbox.selected,
.toggle-radio.selected,
.days-check-item.selected {
    background: var(--glass-primary-bg) !important;
    border-color: rgba(43, 152, 255, 0.20) !important;
    color: var(--text-primary) !important;
}
input[type="checkbox"],
input[type="radio"] { display: none; }

.big-device-option {
    display: block;
    width: 100%;
    padding: 24px 16px;
    margin: 16px 0;
    text-align: center;
    background: var(--card-bg);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-primary);
}
.big-device-option i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
}
.big-device-option:hover {
    background: var(--hover-bg);
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    opacity: 0.3;
}
::-webkit-scrollbar-thumb:hover { opacity: 0.6; }

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* موبایل کوچک (تا 480px) */
@media (max-width: 480px) {
    .main-content { padding: 40px 8px 16px; }
    .global-header { padding: 10px 12px; }
    .global-header .header-left .menu-logo { height: 42px; width: 42px; }
    .global-header .header-left .header-title-group .main-title { font-size: 1rem; }
    .global-header .header-left .header-title-group .sub-title {
        font-size: 0.6rem;
        max-width: 100px;
    }
    .tab-bar .tab-btn { font-size: 0.65rem; padding: 4px 8px; }
    .relay-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .scenario-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .modal-content { padding: 16px; }
    
    /* ===== سایدبار در موبایل با فاصله 40px ===== */
    .sidebar {
        top: 40px;
        bottom: calc(-15px + var(--safe-area-bottom, 0px));
        width: 88%;
        max-width: 260px;
    }
    
    .mgmt-btn .btn-title { font-size: 0.8rem; }
    .mgmt-btn .btn-desc { font-size: 0.6rem; }
    .passcode-box { width: 90%; padding: 20px 16px; }
    .passcode-box .logo-passcode { width: 70px; height: 70px; }
    .news-card .news-title { font-size: 0.9rem; }
    .news-card .news-message { font-size: 0.8rem; }
}

/* موبایل متوسط و تبلت کوچک (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .main-content { padding: 65px 12px 20px; }
    .global-header .header-left .header-title-group .main-title { font-size: 1.2rem; }
    .global-header .header-left .header-title-group .sub-title {
        font-size: 0.75rem;
        max-width: 140px;
    }
    .relay-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .scenario-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .sidebar { width: 80%; max-width: 270px; }
}

/* تبلت بزرگ و دسکتاپ کوچک (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .relay-grid { grid-template-columns: repeat(3, 1fr); }
    .scenario-grid { grid-template-columns: repeat(4, 1fr); }
    .main-content { padding: 70px 20px 30px; }
}

/* دسکتاپ بزرگ (≥1025px) */
@media (min-width: 1025px) {
    .relay-grid { grid-template-columns: repeat(4, 1fr); }
    .scenario-grid { grid-template-columns: repeat(6, 1fr); }
    .main-content { padding: 20px 24px 40px; }
    .global-header .header-left .header-title-group .sub-title {
        max-width: 300px;
    }
}

/* جلوگیری از overflow در همه اندازه‌ها */
img, svg, video, canvas, iframe {
    max-width: 100%;
    height: auto;
}

/* تنظیمات لمسی برای موبایل */
body.sidebar-open {
    overflow: hidden;
    touch-action: none;
}

html, body {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
}

/* اجازه اسکرول در بخش‌های خاص */
.sidebar-scrollable,
.modal-content,
.device-submenu.show,
.device-items-list.show {
    touch-action: pan-y;
}

.sidebar,
.modal {
    touch-action: none;
}


/* =============================================
   یکسان‌سازی اجباری سایدبار - نهایی
   ============================================= */

/* حذف کامل فضای badge خالی */
.update-badge:empty {
    display: none !important;
}

/* تنظیم ردیف تنظیمات */
.settings-row {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    width: 100% !important;
}

/* همه دکمه‌های متنی دقیقاً یکسان */
#newDashboardBtn,
#addDeviceBtn,
#settingsBtn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 8px !important;
    line-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    font-weight: bold !important;
    border-radius: 32px !important;
    background: var(--btn-glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--btn-glass-border) !important;
    color: var(--btn-glass-text) !important;
    box-shadow: var(--shadow) !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

/* دکمه‌های گرد دقیقاً ۴۰ پیکسل */
.alarm-btn,
.support-btn,
.theme-toggle {
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
}
/* =============================================
   هم‌ارتفاع کردن سلکت و دکمه در فرم زمانبندی
   ============================================= */
   #scheduleFormContainer select,
   #scheduleFormContainer button {
       height: 44px !important;
       padding: 0 16px !important;
       font-size: 0.85rem !important;
       border-radius: 32px !important;
       box-sizing: border-box !important;
       display: inline-flex !important;
       align-items: center !important;
       justify-content: center !important;
       width: 100% !important; /* ← عرض کامل مثل قبل */
       margin: 6px 0 !important;
   }
   
   #scheduleFormContainer select {
       background: var(--input-bg) !important;
       border: 1px solid var(--input-border) !important;
       color: var(--text-primary) !important;
       appearance: auto !important;
       -webkit-appearance: auto !important;
   }
   
   #scheduleFormContainer button {
       background: var(--btn-glass-bg) !important;
       backdrop-filter: blur(20px) !important;
       -webkit-backdrop-filter: blur(20px) !important;
       border: 1px solid var(--btn-glass-border) !important;
       color: var(--btn-glass-text) !important;
       font-weight: bold !important;
       cursor: pointer !important;
       transition: 0.15s !important;
   }
   
   #scheduleFormContainer button:hover {
       background: var(--hover-bg) !important;
       transform: translateY(-2px) !important;
   }

 /* =============================================
   افزایش فاصله بخش‌های فرم زمانبندی (۱۸٪ بیشتر)
   ============================================= */

/* کل فرم */
#scheduleFormContainer {
    display: flex;
    flex-direction: column;
    gap: 18px; /* ← از 20 به 18 تغییر کرد */
}

/* ردیف‌های افقی داخل فرم (مثلاً انتخاب نوع عملیات یا روزها) */
#scheduleFormContainer .flex-row {
    gap: 14px; /* ← از 18 به 14 تغییر کرد */
}

/* بخش دکمه‌های رله و روزهای هفته */
#scheduleFormContainer #relayChecks,
#scheduleFormContainer #daysCheck {
    gap: 12px; /* ← از 14 به 12 تغییر کرد */
}

/* بخش تاریخ (سال، ماه، روز) - اگر افقی باشه */
#scheduleFormContainer #dateDiv .flex-row {
    gap: 14px; /* ← از 18 به 14 تغییر کرد */
}

/* فاصله بین بخش‌های مختلف (اختیاری) */
#scheduleFormContainer > * {
    margin-bottom: 4px; /* ← از 6 به 4 تغییر کرد */
}

/* =============================================
   تغییر رنگ المان‌های انتخاب‌شده به آبی روشن (#23a6ff)
   ============================================= */

/* ۱. دکمه‌های تاگل (انتخاب نوع عملیات، رله‌ها، روزها، سناریوها) */
.toggle-checkbox.selected,
.toggle-radio.selected,
.days-check-item.selected {
    background: #23a6ff !important;
    border-color: #23a6ff !important;
    color: #ffffff !important;
}

/* ۲. تب‌های بالای صفحه (هدر) */
.tab-bar .tab-btn.active {
    background: #23a6ff !important;
    border-color: #23a6ff !important;
    color: #ffffff !important;
}

/* ۳. چک‌باکس‌های عمودی داخل مودال (محدوده‌ها) */
.dashboard-checkboxes-vertical .toggle-checkbox.selected {
    background: #23a6ff !important;
    border-color: #23a6ff !important;
    color: #ffffff !important;
}

/* ۴. دکمه‌های انتخاب در فرم افزودن دکمه به محدوده */
.device-items-list .toggle-checkbox.selected {
    background: #23a6ff !important;
    border-color: #23a6ff !important;
    color: #ffffff !important;
}

.relay-card, .scenario-card {
    touch-action: manipulation;
    cursor: pointer;
}

/* =============================================
   استایل دایره چشمک‌زن (افکت رادار با سرعت ۳۵٪ کمتر)
   ============================================= */
   .radar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    position: relative;
    width: 120px;
    height: 120px;
}
.radar-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #1a95e8;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px rgba(26, 149, 232, 0.6);
    animation: pulse 0.38s ease-in-out infinite;  /* ← زمان بیشتر = سرعت کمتر */
}
.radar-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(26, 149, 232, 0.25);
    z-index: -1;
    animation: radar 0.6s ease-out infinite;  /* ← زمان بیشتر = سرعت کمتر */
}
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 30px rgba(26,149,232,0.6); }
    50% { transform: scale(1.15); box-shadow: 0 0 80px rgba(26,149,232,0.9); }
    100% { transform: scale(1); box-shadow: 0 0 30px rgba(26,149,232,0.6); }
}
@keyframes radar {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* =============================================
   استایل نماد وایفای (خطوط با fade از پایین به بالا)
   ============================================= */
   .wifi-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
}
.wifi-icon {
    width: 200px;
    height: 200px;
}
.wifi-dot {
    fill: #1a95e8;
    animation: none;
}
.wifi-arc {
    fill: none;
    stroke: #1a95e8;
    stroke-width: 10;  /* ← کلفت‌تر از قبل (6 → 10) */
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
}
.arc-1 {
    animation: fadeWifi1 4s ease-in-out infinite;
}
.arc-2 {
    animation: fadeWifi2 4s ease-in-out infinite;
}
.arc-3 {
    animation: fadeWifi3 4s ease-in-out infinite;
}
@keyframes fadeWifi1 {
    0% { opacity: 0; }
    10% { opacity: 0; }
    20% { opacity: 1; }
    45% { opacity: 1; }
    60% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes fadeWifi2 {
    0% { opacity: 0; }
    25% { opacity: 0; }
    35% { opacity: 1; }
    55% { opacity: 1; }
    70% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes fadeWifi3 {
    0% { opacity: 0; }
    40% { opacity: 0; }
    50% { opacity: 1; }
    70% { opacity: 1; }
    85% { opacity: 0; }
    100% { opacity: 0; }
}


/* =============================================
   استایل دایره با افکت نوری نرم + هاله (glow) پررنگ‌تر
   ============================================= */
   .light-effect-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #1a95e8;
    position: relative;
    margin: 25px auto;
    overflow: hidden;
    /* هاله‌ی نرم با شعاع بیشتر و رنگ پررنگ‌تر */
    box-shadow: 
        0 0 40px rgba(26, 149, 232, 0.5),
        0 0 80px rgba(26, 149, 232, 0.25),
        0 0 120px rgba(26, 149, 232, 0.12);
    animation: glowPulse 3s ease-in-out infinite;
}
.light-effect-circle::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -60%;
    width: 220%;
    height: 220%;
    background: radial-gradient(
        ellipse at 30% 30%, 
        rgba(255, 255, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0) 55%
    );
    animation: rotateLight 5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes rotateLight {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes glowPulse {
    0% { 
        box-shadow: 
            0 0 40px rgba(26,149,232,0.5),
            0 0 80px rgba(26,149,232,0.25),
            0 0 120px rgba(26,149,232,0.12);
    }
    50% { 
        box-shadow: 
            0 0 60px rgba(26,149,232,0.7),
            0 0 120px rgba(26,149,232,0.35),
            0 0 180px rgba(26,149,232,0.18);
    }
    100% { 
        box-shadow: 
            0 0 40px rgba(26,149,232,0.5),
            0 0 80px rgba(26,149,232,0.25),
            0 0 120px rgba(26,149,232,0.12);
    }
}

.support-btn-inline {
    background: #1a95e8 !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 16px;
    border-radius: 32px;
    cursor: pointer;
    font-weight: bold;
}

/* افزایش فاصله آیکون از متن در دکمه‌های مدیریت دستگاه */
.mgmt-btn .btn-icon {
    margin-left: 16px !important;  /* یا مقدار دلخواه */
}

.scenario-number {
    font-size: 0.6rem;   /* ۴۰٪ کوچکتر از اندازهٔ پیش‌فرض (۱rem) */
    opacity: 0.7;
    margin-top: 4px;     /* فاصله از اموجی */
    font-weight: 400;    /* سبک‌تر از حالت پررنگ */
}
.scenario-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}
.scenario-card .scenario-emoji {
    order: 1 !important;
}
.scenario-card .scenario-number {
    order: 2 !important;
}
.scenario-card .scenario-name {
    order: 3 !important;
}

/* افزایش ارتفاع دکمه همبرگری (منو) */
#menuToggleBtn {
    padding: 14px 12px !important;   /* ← مقدار 14px را بیشتر کنید تا ارتفاع بیشتر شود */
    line-height: 1.2 !important;
    font-size: 1.4rem !important;    /* سایز آیکون را هم می‌توانید تنظیم کنید */
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px !important;  /* گوشه‌های گرد (اختیاری) */
}

#qrZoomBtn {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    border-radius: 32px;
    background: var(--glass-primary-bg) !important;
    border: 1px solid rgba(43, 152, 255, 0.20) !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
#qrZoomBtn:hover {
    background: rgba(43, 152, 255, 0.20) !important;
    transform: translateY(-2px);
}

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}
.qr-container img {
    max-width: 100% !important;
    height: auto !important;
}

|

/* =============================================
   iOS Install Guide (PWA نصب) - طراحی حرفه‌ای
   ============================================= */

   #iosInstallGuide {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    z-index: 999999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    animation: iosFadeIn 0.3s ease !important;
    transform: none !important;
    -webkit-transform: none !important;
    pointer-events: auto !important;
}

.ios-guide-overlay {
    display: contents !important;
}

.ios-guide-box {
    background: linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.98) 100%) !important;
    backdrop-filter: blur(60px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(60px) saturate(200%) !important;
    border-radius: 36px !important;
    padding: 40px 28px 28px !important;
    max-width: 420px !important;
    width: 100% !important;
    position: relative !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255,255,255,0.6) !important;
    animation: iosSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    margin: 0 auto !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    text-align: center !important;
}

/* نسخه تاریک */
body.dark .ios-guide-box {
    background: linear-gradient(145deg, rgba(30,35,50,0.95) 0%, rgba(20,25,40,0.98) 100%) !important;
    border-color: rgba(255,255,255,0.06) !important;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

/* دکمه بستن (×) - ظریف‌تر */
.ios-guide-close {
    position: absolute !important;
    top: 14px !important;
    left: 18px !important;
    background: rgba(0,0,0,0.04) !important;
    border: none !important;
    font-size: 1.3rem !important;
    color: var(--text-secondary) !important;
    cursor: pointer !important;
    padding: 6px 10px !important;
    border-radius: 50% !important;
    transition: 0.25s !important;
    line-height: 1 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ios-guide-close:hover {
    background: rgba(0,0,0,0.08) !important;
    transform: rotate(90deg) !important;
}

body.dark .ios-guide-close {
    background: rgba(255,255,255,0.04) !important;
}

body.dark .ios-guide-close:hover {
    background: rgba(255,255,255,0.08) !important;
}


@keyframes iosIconBounce {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* عنوان */
.ios-guide-box h3 {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    margin-bottom: 4px !important;
    color: var(--text-primary) !important;
    letter-spacing: -0.5px !important;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.dark .ios-guide-box h3 {
    background: linear-gradient(135deg, #ffffff 0%, #4ba5ff 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* توضیحات */
.ios-guide-box > p {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    margin-bottom: 20px !important;
    line-height: 1.6 !important;
    opacity: 0.8 !important;
}

/* لیست مراحل - با شماره‌های رنگی */
.ios-guide-steps {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
    text-align: right !important;
}

.ios-step {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    background: rgba(43, 152, 255, 0.04) !important;
    padding: 12px 16px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(43, 152, 255, 0.06) !important;
    transition: 0.25s !important;
    text-align: right !important;
}

.ios-step:hover {
    background: rgba(43, 152, 255, 0.08) !important;
    transform: translateX(-4px) !important;
}

body.dark .ios-step {
    background: rgba(43, 152, 255, 0.03) !important;
    border-color: rgba(43, 152, 255, 0.04) !important;
}

body.dark .ios-step:hover {
    background: rgba(43, 152, 255, 0.06) !important;
}

/* شماره مرحله - با گرادینت */
.ios-step-num {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4ba5ff 100%) !important;
    color: #ffffff !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 12px rgba(43, 152, 255, 0.2) !important;
}

body.dark .ios-step-num {
    box-shadow: 0 4px 12px rgba(43, 152, 255, 0.1) !important;
}

/* متن مرحله */
.ios-step-text {
    font-size: 0.85rem !important;
    color: var(--text-primary) !important;
    line-height: 1.4 !important;
}

.ios-step-text strong {
    font-weight: 700 !important;
    color: var(--primary-color) !important;
}

body.dark .ios-step-text strong {
    color: #4ba5ff !important;
}

/* آیکون اشتراک‌گذاری iOS - SVG */
.ios-share-icon {
    display: inline-block !important;
    width: 22px !important;
    height: 22px !important;
    vertical-align: middle !important;
    margin: 0 4px !important;
    stroke: var(--primary-color) !important;
    flex-shrink: 0 !important;
    transition: 0.2s !important;
}

.ios-step:hover .ios-share-icon {
    transform: scale(1.15) !important;
}

/* نسخه تاریک */
body.dark .ios-share-icon {
    stroke: #4ba5ff !important;
}

/* دکمه "متوجه شدم" - با گرادینت و سایه */
.ios-guide-btn {
    width: 100% !important;
    padding: 16px !important;
    border: none !important;
    border-radius: 32px !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4ba5ff 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    transition: 0.3s !important;
    box-shadow: 0 4px 20px rgba(43, 152, 255, 0.3) !important;
    letter-spacing: 0.3px !important;
}

.ios-guide-btn:hover {
    opacity: 1 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 32px rgba(43, 152, 255, 0.4) !important;
}

.ios-guide-btn:active {
    transform: scale(0.97) !important;
}

body.dark .ios-guide-btn {
    box-shadow: 0 4px 20px rgba(43, 152, 255, 0.15) !important;
}

body.dark .ios-guide-btn:hover {
    box-shadow: 0 8px 32px rgba(43, 152, 255, 0.25) !important;
}

/* دکمه "دیگه نشون نده" - ظریف */
.ios-guide-dismiss {
    display: block !important;
    width: 100% !important;
    margin-top: 12px !important;
    padding: 8px !important;
    background: none !important;
    border: none !important;
    color: var(--text-secondary) !important;
    font-size: 0.7rem !important;
    cursor: pointer !important;
    opacity: 0.4 !important;
    transition: 0.25s !important;
    text-decoration: none !important;
    font-weight: 400 !important;
}

.ios-guide-dismiss:hover {
    opacity: 0.8 !important;
}

/* ===== انیمیشن‌ها ===== */

@keyframes iosFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes iosSlideUp {
    from { transform: translateY(40px) scale(0.92); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===== ریسپانسیو ===== */

@media (max-width: 480px) {
    .ios-guide-box {
        padding: 28px 18px 20px !important;
        border-radius: 28px !important;
        max-width: 95% !important;
        margin: -10px auto 0 auto !important;
    }

    .ios-guide-icon {
        font-size: 3.2rem !important;
    }

    .ios-guide-box h3 {
        font-size: 1.15rem !important;
    }

    .ios-guide-box > p {
        font-size: 0.78rem !important;
        margin-bottom: 16px !important;
    }

    .ios-step {
        padding: 10px 12px !important;
        gap: 10px !important;
    }

    .ios-step-text {
        font-size: 0.78rem !important;
    }

    .ios-step-num {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.6rem !important;
    }

    .ios-guide-btn {
        padding: 14px !important;
        font-size: 0.9rem !important;
    }

    .ios-guide-close {
        top: 10px !important;
        left: 12px !important;
        font-size: 1.1rem !important;
        width: 32px !important;
        height: 32px !important;
    }

    .ios-guide-steps {
        gap: 8px !important;
    }
}

@media (max-width: 380px) {
    .ios-guide-box {
        padding: 20px 14px 16px !important;
        border-radius: 24px !important;
    }

    .ios-guide-icon {
        font-size: 2.6rem !important;
    }

    .ios-guide-box h3 {
        font-size: 1rem !important;
    }

    .ios-step-text {
        font-size: 0.7rem !important;
    }
}

/* =============================================
   لوگو با افکت برق‌زدن (Glow Effect)
   ============================================= */

   .ios-guide-icon.ios-guide-logo {
    width: 90px !important;
    height: 90px !important;
    border-radius: 50% !important;
    object-fit: contain !important;
    background: transparent !important;
    display: inline-block !important;
    margin: 0 auto 12px auto !important;
    animation: iosLogoGlow 2.5s ease-in-out infinite !important;
    box-shadow: 0 0 30px rgba(43, 152, 255, 0.15) !important;
    transition: all 0.3s !important;
}

/* انیمیشن برق‌زدن (Glow + Pulse) */
@keyframes iosLogoGlow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(43, 152, 255, 0.15), 0 0 40px rgba(43, 152, 255, 0.05);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 40px rgba(43, 152, 255, 0.4), 0 0 80px rgba(43, 152, 255, 0.15), 0 0 120px rgba(43, 152, 255, 0.05);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(43, 152, 255, 0.15), 0 0 40px rgba(43, 152, 255, 0.05);
    }
}

/* ===== نسخه تاریک ===== */
body.dark .ios-guide-icon.ios-guide-logo {
    box-shadow: 0 0 30px rgba(43, 152, 255, 0.08) !important;
}

body.dark .ios-guide-icon.ios-guide-logo {
    filter: drop-shadow(0 0 20px rgba(43, 152, 255, 0.1));
}

@keyframes iosLogoGlowDark {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(43, 152, 255, 0.05);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 40px rgba(43, 152, 255, 0.2), 0 0 80px rgba(43, 152, 255, 0.08);
        filter: brightness(1.15);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(43, 152, 255, 0.05);
    }
}

body.dark .ios-guide-icon.ios-guide-logo {
    animation-name: iosLogoGlowDark !important;
}