/* ==========================================
   HOME PAGE SPECIFIC STYLES
   ========================================== */

/* ==========================================
   СЕТКА КАРТОЧЕК СЕРВИСОВ И СТАТУСЫ
   ========================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    max-width: 1000px;
}

/* Карточка сервиса */
.service-card {
    position: relative;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px 24px; /* Увеличили боковые отступы внутри карточки */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.2s ease, 
                border-color 0.2s ease, 
                background-color 0.2s ease;
}

.service-card:hover {
    background: rgba(30, 41, 59, 0.85);
    transform: translateY(-3px);
}

/* 🟢 Статус: Онлайн (сочное зелёное свечение) */
.service-card.is-online {
    border: 1px solid #384b3e; /* Сделали рамку чуть толще (2px) */
    box-shadow: 
        0 0 6px rgba(34, 197, 94, 0.4),  /* Яркий контур */
        0 0 12px rgba(34, 197, 94, 0.25); /* Мягкое внешнее облако */
}

.service-card.is-online:hover {
    border-color: #3a9f6b; /* Чуть светлее при наведении */
    box-shadow: 
        0 0 10px rgba(34, 197, 94, 0.7),  /* Интенсивный контур */
        0 0 20px rgba(34, 197, 94, 0.45), /* Большое яркое свечение */
        0 8px 16px rgba(0, 0, 0, 0.4);    /* Подложка-тень для объёма */
}

/* 🔴 Статус: Офлайн (сочное красное свечение) */
.service-card.is-offline {
    border: 1px solid #ef4444; /* Сделали рамку чуть толще (2px) */
    box-shadow: 
        0 0 6px rgba(239, 68, 68, 0.4),  /* Яркий контур */
        0 0 12px rgba(239, 68, 68, 0.25); /* Мягкое внешнее облако */
}

.service-card.is-offline:hover {
    border-color: #f87171; /* Чуть светлее при наведении */
    box-shadow: 
        0 0 15px rgba(239, 68, 68, 0.7),  /* Интенсивный контур */
        0 0 40px rgba(239, 68, 68, 0.45), /* Большое яркое свечение */
        0 8px 16px rgba(0, 0, 0, 0.4);    /* Подложка-тень для объёма */
}

/* Кнопка 3 точек (Меню) — ПОСТОЯННО ВИДИМАЯ */
.service-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.05); /* Легкая подложка, чтобы кнопка выделялась */
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 1; /* Постоянная видимость */
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    z-index: 2;
}

.service-menu:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Контент карточки */
.service-icon {
    font-size: 2.2rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.08);
}

.service-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #f1f5f9;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Карточка добавления нового сервиса */
.service-card.add-card {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    box-shadow: none;
    background: transparent;
}

.service-card.add-card:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.05);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.service-card.add-card .service-icon {
    color: #38bdf8;
    font-weight: 300;
}

/* ==========================================
   МОДАЛЬНОЕ ОКНО
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-field label {
    font-size: 0.8rem;
    color: #94a3b8;
}

.settings-field input {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}

.settings-field input:focus {
    border-color: #38bdf8;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.modal-buttons button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: background 0.2s;
}

.modal-buttons button.primary {
    background: #38bdf8;
    border: none;
    color: #0f172a;
    font-weight: 600;
}

.modal-buttons button:hover {
    opacity: 0.9;
}

/* Контейнер для уведомлений (Toast) */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}