/* ================================================================ */
/*  VARIOglide WebApp — componenti configuratore BLE                */
/*  I token di tema (colori, font) sono definiti in site.css        */
/* ================================================================ */

/* ================================================================ */
/*                          STATUS BAR                               */
/* ================================================================ */

.status-bar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s, box-shadow 0.3s, border 0.3s;
}

.status-indicator.disconnected {
    background-color: transparent;
    border: 1.5px solid var(--text-dim);
}

.status-indicator.connected {
    background-color: var(--climb);
    border: none;
    box-shadow: 0 0 8px rgba(57, 217, 138, 0.5);
}

.status-indicator.scanning {
    background-color: var(--sky);
    border: none;
    animation: pulse 1.2s ease-in-out infinite;
}

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

.status-text {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

.device-name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--sky);
    margin-left: auto;
}

/* ================================================================ */
/*                          MAIN CONTENT                             */
/* ================================================================ */

.main-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
}

.logo {
    display: block;
    max-width: 320px;
    width: 85%;
    height: auto;
    margin: 8px auto 28px;
    filter: drop-shadow(0 12px 40px rgba(74, 179, 244, 0.18));
}

/* ================================================================ */
/*                           BUTTONS                                 */
/* ================================================================ */

.btn-primary-custom {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background-color: var(--sky);
    color: #0B1220;
    border: 1px solid var(--sky);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn-primary-custom:hover {
    background-color: #6DC4F8;
    border-color: #6DC4F8;
}

.btn-primary-custom:active {
    transform: scale(0.98);
}

.btn-secondary-custom {
    display: block;
    width: 100%;
    padding: 13px 20px;
    background-color: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn-secondary-custom:hover {
    background-color: var(--surface-2);
    border-color: var(--sky);
    color: var(--sky);
}

.btn-secondary-custom:active {
    transform: scale(0.98);
}

.btn-disconnect {
    background-color: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-disconnect:hover {
    background-color: rgba(229, 96, 76, 0.08);
    border-color: var(--danger);
}

/* ================================================================ */
/*                       SCANNING INDICATOR                          */
/* ================================================================ */

.scanning-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 0;
    margin-bottom: 8px;
}

.scanning-indicator.visible {
    display: flex;
}

.scanning-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--line);
    border-top-color: var(--sky);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.scanning-text {
    font-size: 13px;
    color: var(--text-dim);
}

/* ================================================================ */
/*                        SECTION HEADERS                            */
/* ================================================================ */

.section-header {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    color: var(--text-dim);
    margin: 28px 0 12px;
}

/* ================================================================ */
/*                        QUICK ACTIONS                              */
/* ================================================================ */

.quick-actions {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
}

.quick-actions .btn-secondary-custom {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================================================================ */
/*                      CONFIGURATION CARD                           */
/* ================================================================ */

.config-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-top: 16px;
}

.config-item {
    text-align: center;
}

.config-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.config-item-title .arrow {
    font-size: 13px;
}

.config-item-title .arrow.up {
    color: var(--climb);
}

.config-item-title .arrow.down {
    color: var(--warn);
}

.config-item-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.5;
}

.config-divider {
    height: 1px;
    background-color: var(--line-soft);
    margin: 18px 0;
}

/* ================================================================ */
/*                         INPUT FIELDS                              */
/* ================================================================ */

.input-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.input-field {
    width: 130px;
    padding: 10px 12px;
    background-color: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--text);
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px var(--sky-soft);
}

/* Frecce dei campi numerici in tema scuro */
.input-field::-webkit-inner-spin-button {
    opacity: 1;
}

.input-unit {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
}

/* ================================================================ */
/*                        RADIO BUTTONS                              */
/* ================================================================ */

.radio-group {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.radio-group input[type="radio"] {
    accent-color: var(--sky);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ================================================================ */
/*                         TOAST MESSAGE                             */
/* ================================================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast-message {
    background-color: var(--surface-3);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.toast-message.visible {
    opacity: 1;
}

/* ================================================================ */
/*                          HIDDEN UTILITY                           */
/* ================================================================ */

.hidden {
    display: none !important;
}

/* ================================================================ */
/*                        ERROR MESSAGE                              */
/* ================================================================ */

.error-text {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
}

/* ================================================================ */
/*                       NOT SUPPORTED BANNER                        */
/* ================================================================ */

.not-supported {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-dim);
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.not-supported strong {
    color: var(--warn);
}
