/* Темная тема для новой карточки AtomPot */

/* Geometria Font - только TTF для правильного отображения кириллицы */
@font-face {
    font-family: 'Geometria';
    src: url('/fonts/Geometria-Medium.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Geometria';
    src: url('/fonts/Geometria-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Geometria';
    src: url('/fonts/Geometria-Medium.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Geometria';
    src: url('/fonts/Geometria-Medium.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

.new-atompot-card {
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #292F38;
    border-radius: 13px;
    color: #E2E8F0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 400px;
    flex-shrink: 0;
}

.new-atompot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.new-atompot-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.new-atompot-online-indicator {
    width: 9.5px;
    height: 9.5px;
    border-radius: 50%;
    background-color: #00F946;
}

.new-atompot-offline-indicator {
    width: 9.5px;
    height: 9.5px;
    border-radius: 50%;
    background-color: #E32828;
}

.new-atompot-header-buttons {
    display: flex;
    gap: 8px;
}

.new-atompot-header-buttons .btn {
    padding: 6px 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: #E2E8F0;
    border-radius: 13px;
    transition: background-color 0.2s;
}

.new-atompot-header-buttons .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.new-atompot-time {
    font-size: 12px;
    color: #A0AEC0;
}

/* Card с сенсорами */
.sensors-card {
    margin: 16px;
    background-color: #3D4553 !important;
    border: none !important;
    border-radius: 13px !important;
}

.sensors-card .card-body {
    padding: 20px !important;
}

/* Сетка сенсоров */
.sensors-grid-container {
    position: relative;
    min-height: 240px;
    padding: 16px;
}

.sensor-item {
    position: absolute;
    background-color: transparent;
    text-align: center;
    max-width: 110px;
}

.sensor-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sensor-top-left {
    top: 2px;
    left: 2px;
}

.sensor-top-right {
    top: 2px;
    right: 2px;
}

.sensor-bottom-left {
    bottom: 2px;
    left: 2px;
}

.sensor-bottom-right {
    bottom: 2px;
    right: 2px;
}

.sensor-label {
    font-size: 11px;
    color: #A0AEC0;
    margin-bottom: 4px;
}

.sensor-value {
    font-size: 24px;
    font-weight: 600;
    color: #E2E8F0;
}

.sensor-unit {
    font-size: 16px;
    color: #A0AEC0;
}

/* Центральный круговой индикатор дня цикла */
.circular-day-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 165px;
    height: 165px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.circular-day-ring {
    width: 100%;
    height: 100%;
    position: absolute;
}

.circular-day-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.circular-day-label {
    font-size: 13px;
    color: #A0AEC0;
    margin-bottom: 4px;
}

.circular-day-number {
    font-size: 48px;
    font-weight: 700;
    color: #33BB51;
    line-height: 1;
    margin-bottom: 4px;
}

.circular-day-phase {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CBD5E0;
}

.circular-day-phase .bi {
    font-size: 18px;
}

/* Вкладки */
.atompot-tabs {
    background-color: #606D82;
    border-radius: 13px;
    margin: 0 16px 16px 16px;
    padding: 4px;
    display: flex;
    gap: 4px;
}

.atompot-tab-button {
    flex: 1;
    background-color: transparent;
    border: none;
    color: #A0AEC0;
    padding: 12px;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atompot-tab-button:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.atompot-tab-button.active {
    background-color: #33BB51;
    color: white;
}

.atompot-tab-content {
    padding: 20px;
}

/* Контент вкладки освещения */
.lighting-tab-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lamp-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.lamp-svg-button {
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 13px;
}

.lamp-svg-button:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.lamp-button {
    padding: 16px;
    border-radius: 13px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.lamp-button.active {
    background-color: #FFA600;
    color: white;
}

.lamp-button.inactive {
    background-color: rgba(255, 255, 255, 0.1);
    color: #A0AEC0;
}

.lighting-mode-label {
    font-size: 14px;
    color: white;
    margin-bottom: 12px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Круговой циферблат 24 часа */
.circular-time-clock {
    width: 240px;
    height: 240px;
    margin: 20px auto;
    position: relative;
}

.clock-ring {
    width: 100%;
    height: 100%;
}

.clock-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.clock-hours-select {
    background-color: #606D82;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    padding: 10px 12px;
    color: #E2E8F0;
    font-size: 14px;
    outline: none;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    min-width: 120px;
}

.clock-hour-markers {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.clock-hour-text {
    position: absolute;
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    transform: translate(-50%, -50%);
}

.clock-hour-text.active {
    color: #FFA600;
    font-weight: 700;
}

/* SVG text для циферблата */
.clock-hour-text-svg {
    font-size: 13px;
    font-weight: 600;
    fill: #718096;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.clock-hour-text-svg.active {
    fill: #FFA600;
    font-weight: 700;
}

.dosvet-section {
    margin-top: 20px;
}

.dosvet-label {
    font-size: 14px;
    color: white;
    margin-bottom: 8px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dosvet-select {
    width: 45%;
    background-color: #606D82;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    padding: 10px 12px;
    color: #E2E8F0;
    font-size: 14px;
    outline: none;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
}

.dosvet-select:focus {
    border-color: #33BB51;
}

.lamp-badge {
    font-size: 14px;
    padding: 16px;
    border-radius: 13px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Контент вкладки полива */
.irrigation-tab-description {
    font-size: 13px;
    color: white;
    margin-bottom: 16px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.irrigation-channels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.irrigation-channel-svg {
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 13px;
}

.irrigation-channel-svg:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.irrigation-channel-card {
    aspect-ratio: 1;
    border-radius: 13px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.irrigation-channel-card.active {
    background-color: #33BB51;
    color: white;
}

.irrigation-channel-card.inactive {
    background-color: #BDBDBD;
    color: #212429;
}

.irrigation-channel-card:hover {
    transform: scale(1.05);
}

.manual-watering-section {
    margin-top: 20px;
}

.manual-watering-label {
    font-size: 14px;
    color: white;
    margin-bottom: 8px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.manual-watering-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.manual-watering-controls select {
    flex: 1;
    background-color: #606D82;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    padding: 10px 12px;
    color: #E2E8F0;
    font-size: 14px;
}

.manual-watering-button {
    background-color: #33BB51;
    color: white;
    border: none;
    border-radius: 13px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.manual-watering-button:hover {
    background-color: #2a9943;
}

.warning-message {
    background-color: rgba(237, 137, 54, 0.2);
    border-left: 4px solid #ED8936;
    padding: 12px;
    border-radius: 13px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #FBD38D;
}

.danger-button {
    background-color: #E32828;
    color: white;
    border: none;
    border-radius: 13px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Контент вкладки тренировки */
.training-tab-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.training-description {
    font-size: 13px;
    color: white;
    margin-bottom: 20px;
    line-height: 1.6;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.training-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 13px;
}

.training-toggle-label {
    font-size: 14px;
    color: white;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #33BB51;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Контент вкладки настройки цикла */
.cycle-settings-label {
    font-size: 14px;
    color: white;
    margin-bottom: 8px;
    margin-top: 16px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cycle-settings-label:first-child {
    margin-top: 0;
}

.cycle-settings-select {
    width: 100%;
    background-color: #606D82;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    padding: 12px;
    color: #E2E8F0;
    font-size: 14px;
}

/* Модальное окно "Об AtomPot" */
.atompot-info-modal .modal-content {
    background-color: #3D4553 !important;
    border: none !important;
    border-radius: 13px !important;
    color: #E2E8F0;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 400px;
    margin: 0 auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.atompot-info-modal .modal-body {
    padding: 0 !important;
}

.atompot-info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.atompot-info-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.atompot-info-modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.atompot-info-modal-close:hover {
    opacity: 1;
}

.atompot-info-modal-content {
    padding: 24px;
}

.atompot-info-section {
    margin-bottom: 24px;
}

.atompot-info-section:last-of-type {
    margin-bottom: 32px;
}

.atompot-info-label {
    font-size: 14px;
    color: #A0AEC0;
    margin-bottom: 8px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
}

.atompot-info-value {
    font-size: 16px;
    color: white;
    font-weight: 500;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
}

.atompot-info-delete-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    margin-top: 8px;
}

.atompot-info-delete-label {
    font-size: 14px;
    color: white;
    margin-bottom: 8px;
    font-weight: 500;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
}

.atompot-info-delete-warning {
    font-size: 13px;
    color: #FFA600;
    margin-bottom: 16px;
    line-height: 1.6;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.atompot-info-delete-button {
    width: 48px;
    height: 48px;
    background-color: #E32828;
    border: none;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.atompot-info-delete-button:hover {
    background-color: #c91f1f;
    transform: scale(1.05);
}

/* Модальное окно настройки полива */
.irrigation-settings-modal .modal-content {
    background-color: #3D4553 !important;
    border: none !important;
    border-radius: 13px !important;
    color: #E2E8F0;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 450px;
    margin: 0 auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.irrigation-settings-modal .modal-body {
    padding: 0 !important;
}

.irrigation-settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.irrigation-settings-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.irrigation-settings-modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.irrigation-settings-modal-close:hover {
    opacity: 1;
}

.irrigation-settings-modal-content {
    padding: 20px 24px 24px 24px;
}

.irrigation-settings-field {
    margin-bottom: 20px;
}

.irrigation-settings-label {
    display: block;
    font-size: 14px;
    color: white;
    margin-bottom: 8px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
}

.irrigation-settings-select {
    width: 100%;
    background-color: #606D82;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    padding: 12px 16px;
    color: #E2E8F0;
    font-size: 14px;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23E2E8F0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.irrigation-settings-select:focus {
    border-color: #33BB51;
}

.irrigation-settings-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 20px;
}

.irrigation-settings-toggle-label {
    font-size: 14px;
    color: white;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
}

.irrigation-settings-save-button {
    width: 100%;
    background-color: #33BB51;
    color: white;
    border: none;
    border-radius: 13px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Geometria', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
}

.irrigation-settings-save-button:hover {
    background-color: #2a9943;
}

/* Адаптивность */
@media (max-width: 576px) {
    .sensors-grid-container {
        gap: 12px;
        padding: 16px;
    }

    .circular-day-indicator {
        width: 120px;
        height: 120px;
    }

    .circular-day-number {
        font-size: 40px;
    }

    .sensor-value {
        font-size: 20px;
    }

    .circular-time-clock {
        width: 200px;
        height: 200px;
    }
}

/* Адаптивность для очень узких экранов */
@media (max-width: 360px) {
    .lamp-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lamp-badge {
        width: 100%;
    }
}

/* Адаптивность для экранов 320px */
@media (max-width: 320px) {
    .sensor-item {
        max-width: 90px;
    }

    .sensor-label {
        font-size: 9px;
    }

    .sensor-value {
        font-size: 18px;
    }

    .sensor-unit {
        font-size: 14px;
    }

    .circular-day-indicator {
        width: 100px;
        height: 100px;
    }

    .circular-day-number {
        font-size: 36px;
    }

    .sensors-grid-container {
        min-height: 200px;
    }
}

/* Адаптивность карточки для мобильных */
@media (max-width: 576px) {
    .new-atompot-card {
        width: 100%;
    }
}

/* Контейнер загрузки для табов */
.tab-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    min-height: 200px;
}

/* Индикатор Wi-Fi сигнала (RSSI) */
.signal-indicator {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.signal-bar {
    width: 3px;
    background-color: #ddd;
    border-radius: 1px;
    transition: background-color 0.3s ease;
}

.bar-1 { height: 4px; }
.bar-2 { height: 7px; }
.bar-3 { height: 10px; }
.bar-4 { height: 14px; }

.signal-bar.active {
    background-color: currentColor;
}

.signal-good {
    color: #28a745;
}

.signal-medium {
    color: #ffc107;
}

.signal-poor {
    color: #dc3545;
}

.signal-none {
    color: #6c757d;
}

@media (max-width: 576px) {
    .signal-indicator {
        transform: scale(0.85);
    }
}
