/* ============================================================
   Akıllı Priz Kontrolü — V2 "Enerji Çekirdeği"
   Neumorphic + tema vurgu rengine duyarlı (--sp2-rgb JS ile set edilir)
   Eski tasarım: css/smart-device.css (v1) — silinmedi.
   ============================================================ */

.sp2-widget {
    --sp2-rgb: 23, 162, 184;
    --sp2-hold: 0;
    --sp2-press: 1;
    --sp2-tilt-x: 0deg;
    --sp2-tilt-y: 0deg;
    --sp2-mag-x: 0px;
    --sp2-mag-y: 0px;
    --sp2-nx: 0;
    --sp2-ny: 0;
    --sp2-px: 50%;
    --sp2-py: 46%;
    --sp2-core: 172px;
    --sp2-chamber-h: 272px;
    --sp2-danger: 239, 68, 68;
    --sp2-warn: 245, 158, 11;

    position: relative;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: 22px;
    margin-bottom: 0;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    animation: sp2-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    box-shadow: var(--neu-card-rest, var(--neu-shadow-md)) !important;
}

.sp2-widget.neu-card:hover {
    box-shadow: var(--neu-surface-raised, var(--neu-shadow-md)) !important;
}

.sp2-widget.neu-card[data-state="on"],
.sp2-widget.neu-card[data-state="off"],
.sp2-widget.neu-card[data-state="offline"],
.sp2-widget.neu-card[data-state="unknown"],
.sp2-widget.neu-card[data-state="loading"] {
    box-shadow: var(--neu-card-rest, var(--neu-shadow-md)) !important;
}

.sp2-widget.neu-card[data-state="on"]:hover,
.sp2-widget.neu-card[data-state="off"]:hover,
.sp2-widget.neu-card[data-state="offline"]:hover,
.sp2-widget.neu-card[data-state="unknown"]:hover,
.sp2-widget.neu-card[data-state="loading"]:hover {
    box-shadow: var(--neu-surface-raised, var(--neu-shadow-md)) !important;
}

@keyframes sp2-enter {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Header ---------- */
.sp2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.sp2-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex: 1 1 auto;
}

.sp2-title-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--bg-primary);
    box-shadow: var(--neu-shadow-sm);
    color: rgb(var(--sp2-rgb));
    font-size: 1.15rem;
    transition: box-shadow 0.4s ease, color 0.3s ease;
}

.sp2-widget[data-state="on"] .sp2-title-icon {
    box-shadow: var(--neu-shadow-sm), 0 0 18px rgba(var(--sp2-rgb), 0.35);
}

.sp2-widget[data-state="on"] .sp2-title-icon i {
    animation: sp2-icon-breathe 2.4s ease-in-out infinite;
}

.sp2-widget[data-state="offline"] .sp2-title-icon {
    color: rgb(var(--sp2-danger));
}

.sp2-title-text {
    min-width: 0;
}

.sp2-title-text h4 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp2-title-text span {
    display: block;
    font-size: 0.74rem;
    line-height: 1.3;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp2-header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

/* Canlı durum rozeti */
.sp2-live {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.36rem 0.72rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-primary);
    box-shadow: var(--neu-inset-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: color 0.3s ease;
}

.sp2-live-dot {
    --sp2-ping: rgba(var(--sp2-warn), 0.55);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(var(--sp2-warn));
    animation: sp2-ping 1.6s ease-out infinite;
    transition: background 0.3s ease;
}

.sp2-widget[data-state="on"] .sp2-live-dot,
.sp2-widget[data-state="off"] .sp2-live-dot {
    --sp2-ping: rgba(var(--sp2-rgb), 0.55);
    background: rgb(var(--sp2-rgb));
}

.sp2-widget[data-state="on"] .sp2-live,
.sp2-widget[data-state="off"] .sp2-live {
    color: rgb(var(--sp2-rgb));
}

.sp2-widget[data-state="offline"] .sp2-live-dot {
    --sp2-ping: rgba(var(--sp2-danger), 0.55);
    background: rgb(var(--sp2-danger));
}

.sp2-widget[data-state="offline"] .sp2-live {
    color: rgb(var(--sp2-danger));
}

@keyframes sp2-ping {
    0%   { box-shadow: 0 0 0 0 var(--sp2-ping); }
    100% { box-shadow: 0 0 0 9px transparent; }
}

/* Yenile butonu (cooldown halkası ile) */
.sp2-refresh {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--bg-primary);
    box-shadow: var(--neu-shadow-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: grid;
    place-items: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.sp2-refresh:hover:not(:disabled) {
    color: rgb(var(--sp2-rgb));
    transform: translateY(-1px);
    box-shadow: var(--neu-shadow-md);
}

.sp2-refresh:active:not(:disabled) {
    transform: translateY(1px) scale(0.96);
    box-shadow: var(--neu-inset-sm);
}

.sp2-refresh:focus-visible {
    outline: none;
    box-shadow: var(--neu-shadow-sm), 0 0 0 3px rgba(var(--sp2-rgb), 0.4);
}

.sp2-refresh:disabled {
    cursor: not-allowed;
    color: var(--text-muted);
}

.sp2-refresh > i {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    grid-area: 1 / 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sp2-refresh.is-busy > i {
    animation: sp2-spin 0.8s linear infinite;
}

.sp2-refresh.is-cooldown > i {
    opacity: 0;
    transform: scale(0.6);
}

.sp2-refresh-ring {
    position: absolute;
    inset: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    transform: rotate(-90deg);
    pointer-events: none;
}

.sp2-refresh-ring circle {
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.sp2-refresh-track {
    stroke: rgba(var(--sp2-rgb), 0.1);
}

.sp2-refresh-progress {
    stroke: rgb(var(--sp2-rgb));
    stroke-dasharray: 100.53;
    stroke-dashoffset: 100.53;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sp2-refresh.is-cooldown .sp2-refresh-progress {
    opacity: 1;
}

.sp2-refresh-count {
    position: absolute;
    z-index: 1;
    font-size: 0.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: rgb(var(--sp2-rgb));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sp2-refresh.is-cooldown .sp2-refresh-count {
    opacity: 1;
}

/* ---------- Chamber (enerji odası) ---------- */
.sp2-chamber {
    position: relative;
    height: var(--sp2-chamber-h);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
    perspective: 900px;
    touch-action: manipulation;
    cursor: crosshair;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.035), rgba(0, 0, 0, 0.09));
    box-shadow:
        inset 6px 6px 14px rgba(0, 0, 0, 0.12),
        inset -6px -6px 14px rgba(255, 255, 255, 0.55);
    transition: box-shadow 0.5s ease;
}

.sp2-widget[data-state="on"] .sp2-chamber {
    box-shadow:
        inset 6px 6px 14px rgba(0, 0, 0, 0.12),
        inset -6px -6px 14px rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .sp2-chamber,
body.dark-mode .sp2-chamber {
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.42));
    box-shadow:
        inset 6px 6px 14px rgba(0, 0, 0, 0.45),
        inset -6px -6px 14px rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .sp2-widget[data-state="on"] .sp2-chamber,
body.dark-mode .sp2-widget[data-state="on"] .sp2-chamber {
    box-shadow:
        inset 6px 6px 14px rgba(0, 0, 0, 0.45),
        inset -6px -6px 14px rgba(255, 255, 255, 0.03);
}

/* Izgara zemini */
.sp2-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(var(--sp2-rgb), 0.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--sp2-rgb), 0.11) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask: radial-gradient(ellipse at 50% 46%, #000 28%, transparent 78%);
            mask: radial-gradient(ellipse at 50% 46%, #000 28%, transparent 78%);
    opacity: 0.5;
    transform: translate(calc(var(--sp2-nx) * 10px), calc(var(--sp2-ny) * 8px));
    transition: opacity 0.6s ease;
}

.sp2-widget[data-state="on"] .sp2-grid {
    opacity: 1;
    animation: sp2-grid-pan 10s linear infinite;
}

.sp2-widget[data-state="offline"] .sp2-grid,
.sp2-widget[data-state="unknown"] .sp2-grid {
    opacity: 0.22;
}

@keyframes sp2-grid-pan {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 26px, 26px 0; }
}

/* Radar süpürmesi */
.sp2-sweep {
    position: absolute;
    z-index: 0;
    width: 150%;
    aspect-ratio: 1 / 1;
    left: calc(50% + var(--sp2-nx) * 14px);
    top: calc(50% + var(--sp2-ny) * 10px);
    translate: -50% calc(-50% - 14px);
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        rgba(var(--sp2-rgb), 0) 0deg,
        rgba(var(--sp2-rgb), 0.2) 42deg,
        rgba(var(--sp2-rgb), 0) 72deg);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.sp2-widget[data-state="on"] .sp2-sweep {
    opacity: 1;
    animation: sp2-spin 7s linear infinite;
}

/* Merkez parıltı */
.sp2-glow {
    position: absolute;
    z-index: 0;
    width: 330px;
    height: 330px;
    left: calc(50% + var(--sp2-nx) * 18px);
    top: calc(50% + var(--sp2-ny) * 14px);
    translate: -50% calc(-50% - 14px);
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(var(--sp2-rgb), 0.4) 0%,
        rgba(var(--sp2-rgb), 0.13) 36%,
        transparent 70%);
    filter: blur(6px);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.sp2-widget[data-state="on"] .sp2-glow {
    opacity: 1;
    animation: sp2-glow-breathe 3s ease-in-out infinite;
}

.sp2-chamber.is-tracking .sp2-glow {
    opacity: 0.72;
}

.sp2-widget[data-state="on"] .sp2-chamber.is-tracking .sp2-glow {
    opacity: 1;
}

/* İmleç enerji lekesi */
.sp2-cursor {
    position: absolute;
    z-index: 1;
    width: 150px;
    height: 150px;
    left: var(--sp2-px);
    top: var(--sp2-py);
    translate: -50% -50%;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle,
        rgba(var(--sp2-rgb), 0.42) 0%,
        rgba(var(--sp2-rgb), 0.12) 38%,
        transparent 72%);
    filter: blur(4px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.sp2-chamber.is-tracking .sp2-cursor {
    opacity: 0.95;
}

/* Açıkken yörüngedeki uydular */
.sp2-moons {
    position: absolute;
    z-index: 2;
    width: calc(var(--sp2-core) + 52px);
    height: calc(var(--sp2-core) + 52px);
    left: calc(50% + var(--sp2-mag-x));
    top: calc(50% + var(--sp2-mag-y));
    translate: -50% calc(-50% - 14px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.sp2-widget[data-state="on"] .sp2-moons {
    opacity: 1;
    animation: sp2-spin 8.5s linear infinite;
}

.sp2-widget[data-state="on"].is-holding .sp2-moons {
    animation-duration: 2.4s;
}

.sp2-moons i {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(var(--sp2-rgb));
    box-shadow:
        0 0 10px rgba(var(--sp2-rgb), 0.95),
        0 0 18px rgba(var(--sp2-rgb), 0.45);
}

.sp2-moons i:nth-child(1) {
    top: 0;
    left: 50%;
    margin-left: -4px;
}

.sp2-moons i:nth-child(2) {
    right: 6%;
    bottom: 22%;
}

.sp2-moons i:nth-child(3) {
    left: 6%;
    bottom: 22%;
    width: 5px;
    height: 5px;
    opacity: 0.75;
}

.sp2-widget[data-state="loading"] .sp2-glow {
    opacity: 0.5;
}

@keyframes sp2-glow-breathe {
    0%, 100% { transform: scale(1);    opacity: 0.85; }
    50%      { transform: scale(1.08); opacity: 1; }
}

.sp2-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---------- Çekirdek (buton) ---------- */
.sp2-core {
    position: relative;
    z-index: 3;
    width: var(--sp2-core);
    height: var(--sp2-core);
    border-radius: 50%;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    translate: var(--sp2-mag-x) calc(-14px + var(--sp2-mag-y));
    transform: rotateX(var(--sp2-tilt-x)) rotateY(var(--sp2-tilt-y)) scale(var(--sp2-press));
    transform-style: preserve-3d;
    transition: transform 0.25s ease, translate 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp2-chamber.is-tracking .sp2-core {
    transition: transform 0.12s ease, translate 0s linear;
}

@media (hover: hover) and (pointer: fine) {
    .sp2-core:hover .sp2-ring-outer {
        box-shadow: var(--neu-shadow-md), 0 0 26px rgba(var(--sp2-rgb), 0.4);
    }
}

.sp2-widget.is-holding .sp2-core {
    --sp2-press: 0.975;
    transition: transform 0.12s ease;
}

.sp2-widget[data-state="offline"] .sp2-core,
.sp2-widget[data-state="unknown"] .sp2-core,
.sp2-widget[data-state="loading"] .sp2-core,
.sp2-widget.sp2-locked .sp2-core {
    cursor: not-allowed;
}

.sp2-widget.is-denied .sp2-core {
    animation: sp2-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes sp2-shake {
    10%, 90% { translate: calc(var(--sp2-mag-x) - 1px) calc(-14px + var(--sp2-mag-y)); }
    20%, 80% { translate: calc(var(--sp2-mag-x) + 2px) calc(-14px + var(--sp2-mag-y)); }
    30%, 50%, 70% { translate: calc(var(--sp2-mag-x) - 4px) calc(-14px + var(--sp2-mag-y)); }
    40%, 60% { translate: calc(var(--sp2-mag-x) + 4px) calc(-14px + var(--sp2-mag-y)); }
}

.sp2-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Dış kabartma halka */
.sp2-ring-outer {
    inset: 0;
    background: var(--bg-primary);
    box-shadow: var(--neu-shadow-md);
    transition: box-shadow 0.4s ease;
}

.sp2-core:focus-visible .sp2-ring-outer {
    box-shadow: var(--neu-shadow-md), 0 0 0 3px rgba(var(--sp2-rgb), 0.45);
}

.sp2-widget[data-state="on"] .sp2-ring-outer {
    box-shadow: var(--neu-shadow-md), 0 0 34px -6px rgba(var(--sp2-rgb), 0.55);
}

/* Dönen enerji halkası (conic + mask) */
.sp2-ring-energy {
    inset: 9px;
    background: conic-gradient(from 0deg,
        transparent 0deg,
        rgba(var(--sp2-rgb), 0.05) 110deg,
        rgba(var(--sp2-rgb), 0.95) 200deg,
        rgba(255, 255, 255, 0.95) 214deg,
        rgba(var(--sp2-rgb), 0.85) 228deg,
        transparent 300deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
    filter: drop-shadow(0 0 8px rgba(var(--sp2-rgb), 0.7));
    opacity: 0;
    transition: opacity 0.45s ease;
}

.sp2-widget[data-state="on"] .sp2-ring-energy {
    opacity: 1;
    animation: sp2-spin 2.8s linear infinite;
}

.sp2-widget[data-state="on"].is-holding .sp2-ring-energy {
    animation-duration: 0.9s;
}

.sp2-widget[data-state="off"] .sp2-ring-energy {
    opacity: 0.16;
    animation: sp2-spin 16s linear infinite;
}

.sp2-widget[data-state="off"].is-holding .sp2-ring-energy {
    opacity: 0.55;
    animation-duration: 1.4s;
}

.sp2-widget[data-state="loading"] .sp2-ring-energy {
    opacity: 0.8;
    animation: sp2-spin 0.85s linear infinite;
}

/* İç çukur ray */
.sp2-ring-track {
    inset: 18px;
    background: var(--bg-primary);
    box-shadow:
        inset 4px 4px 9px var(--shadow-inset-dark),
        inset -4px -4px 9px var(--shadow-inset-light);
}

/* Basılı tutma ilerleme yayı */
.sp2-hold {
    position: absolute;
    inset: 15px;
    width: calc(100% - 30px);
    height: calc(100% - 30px);
    transform: rotate(-90deg);
    pointer-events: none;
    overflow: visible;
}

.sp2-hold circle {
    fill: none;
    stroke-width: 3.4;
    stroke-linecap: round;
}

.sp2-hold-track {
    stroke: rgba(var(--sp2-rgb), 0.1);
}

.sp2-hold-progress {
    stroke: rgb(var(--sp2-rgb));
    stroke-dasharray: 289.03;
    stroke-dashoffset: 289.03;
    filter: drop-shadow(0 0 6px rgba(var(--sp2-rgb), 0.85));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sp2-widget.is-holding .sp2-hold-progress,
.sp2-widget.is-releasing .sp2-hold-progress {
    opacity: 1;
}

/* Yüzen iç çekirdek */
.sp2-inner {
    position: absolute;
    inset: 32px;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: var(--neu-shadow-sm);
    display: grid;
    place-items: center;
    transition:
        box-shadow 0.4s ease,
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sp2-widget.is-holding .sp2-inner {
    transform: scale(0.92);
}

.sp2-widget.is-nudge .sp2-inner {
    animation: sp2-nudge 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sp2-nudge {
    0%   { transform: scale(1); }
    32%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.sp2-widget[data-state="on"] .sp2-inner {
    box-shadow:
        var(--neu-shadow-sm),
        0 0 0 2px rgba(var(--sp2-rgb), 0.28),
        0 0 30px rgba(var(--sp2-rgb), 0.45);
}

.sp2-inner > * {
    grid-area: 1 / 1;
}

.sp2-icon {
    font-size: 2.05rem;
    color: var(--text-secondary);
    transition:
        color 0.3s ease,
        text-shadow 0.3s ease,
        opacity 0.25s ease,
        transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sp2-widget[data-state="on"] .sp2-icon {
    color: rgb(var(--sp2-rgb));
    text-shadow:
        0 0 14px rgba(var(--sp2-rgb), 0.9),
        0 0 34px rgba(var(--sp2-rgb), 0.5);
    animation: sp2-icon-breathe 2.6s ease-in-out infinite;
}

.sp2-widget[data-state="offline"] .sp2-icon {
    color: rgb(var(--sp2-danger));
    opacity: 0.75;
}

.sp2-widget[data-state="unknown"] .sp2-icon {
    color: var(--text-muted);
}

.sp2-widget[data-state="loading"] .sp2-icon {
    opacity: 0;
    transform: scale(0.55) rotate(-90deg);
}

@keyframes sp2-icon-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.07); }
}

.sp2-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(var(--sp2-rgb), 0.16);
    border-top-color: rgb(var(--sp2-rgb));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sp2-widget[data-state="loading"] .sp2-spinner {
    opacity: 1;
    animation: sp2-spin 0.8s linear infinite;
}

/* Kilit rozeti (yetkisiz kullanıcı) */
.sp2-lock {
    display: none;
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    place-items: center;
    background: var(--bg-primary);
    box-shadow: var(--neu-shadow-sm);
    color: var(--text-muted);
    font-size: 0.62rem;
}

.sp2-widget.sp2-locked .sp2-lock {
    display: grid;
}

/* Şok dalgası */
.sp2-shockwave {
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    border: 2px solid rgba(var(--sp2-rgb), 0.85);
    box-shadow: 0 0 22px rgba(var(--sp2-rgb), 0.5);
    opacity: 0;
    pointer-events: none;
}

.sp2-shockwave.is-firing {
    animation: sp2-shock 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sp2-shock {
    0%   { opacity: 0.95; transform: scale(0.88); }
    100% { opacity: 0;    transform: scale(2.5); }
}

/* Durum etiketi */
.sp2-state {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 12px;
    text-align: center;
    pointer-events: none;
}

.sp2-state-label {
    display: inline-block;
    padding: 0.32rem 0.95rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: var(--bg-primary);
    box-shadow: var(--neu-inset-sm);
    color: var(--text-secondary);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.sp2-widget[data-state="on"] .sp2-state-label {
    color: rgb(var(--sp2-rgb));
    text-shadow: 0 0 10px rgba(var(--sp2-rgb), 0.5);
}

.sp2-widget[data-state="offline"] .sp2-state-label {
    color: rgb(var(--sp2-danger));
}

.sp2-widget[data-state="loading"] .sp2-state-label {
    color: rgb(var(--sp2-rgb));
    animation: sp2-label-pulse 1s ease-in-out infinite;
}

.sp2-state-label.is-swapping {
    animation: sp2-swap 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sp2-swap {
    0%   { opacity: 0; transform: translateY(8px) scale(0.92); filter: blur(3px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes sp2-label-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* ---------- İpucu ---------- */
.sp2-hint {
    margin: 0.7rem 0 0.6rem;
    min-height: 1.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    text-align: center;
    flex-wrap: wrap;
}

.sp2-hint kbd {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.14rem 0.5rem;
    border-radius: 8px;
    background: var(--bg-primary);
    box-shadow: var(--neu-shadow-sm);
    color: rgb(var(--sp2-rgb));
    transition: box-shadow 0.25s ease;
}

.sp2-hint.is-teach kbd {
    animation: sp2-kbd-pulse 0.7s ease 3;
}

@keyframes sp2-kbd-pulse {
    0%, 100% { box-shadow: var(--neu-shadow-sm); }
    50%      { box-shadow: var(--neu-shadow-sm), 0 0 0 7px rgba(var(--sp2-rgb), 0.28); }
}

/* ---------- Telemetri ---------- */
.sp2-telemetry {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.sp2-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    padding: 0.55rem 0.4rem;
    border-radius: 14px;
    background: var(--bg-primary);
    box-shadow: var(--neu-inset-sm);
    min-width: 0;
    border: none;
    font: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

button.sp2-pill {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .sp2-pill:hover {
        box-shadow: var(--neu-shadow-sm);
        transform: translateY(-1px);
    }
}

button.sp2-pill:active {
    box-shadow: var(--neu-inset-sm);
    transform: translateY(1px);
}

button.sp2-pill:focus-visible {
    outline: none;
    box-shadow: var(--neu-inset-sm), 0 0 0 3px rgba(var(--sp2-rgb), 0.4);
}

.sp2-pill i {
    font-size: 0.75rem;
    color: rgb(var(--sp2-rgb));
    opacity: 0.85;
}

.sp2-pill span {
    font-size: 0.64rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sp2-pill strong {
    font-size: 0.86rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    max-width: 100%;
    width: 100%;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sp2-pill--state strong {
    font-size: 0.82rem;
    font-weight: 650;
}

.sp2-widget[data-state="on"] #sp2TelState {
    color: rgb(var(--sp2-rgb));
}

.sp2-widget[data-state="offline"] #sp2TelState {
    color: rgb(var(--sp2-danger));
}

/* ---------- Ortak keyframes ---------- */
@keyframes sp2-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Koyu tema ince ayarları ---------- */
[data-theme="dark"] .sp2-widget,
body.dark-mode .sp2-widget {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .sp2-ring-track,
body.dark-mode .sp2-ring-track {
    box-shadow:
        inset 5px 5px 10px rgba(0, 0, 0, 0.55),
        inset -4px -4px 9px rgba(255, 255, 255, 0.05);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    /* Hero düğmeleriyle priz arasındaki boşluğu satır aralığı (gap) ve düğme alt boşluğu belirler; ekstra üst boşluk yok */
    .sp2-widget {
        margin-top: 0;
    }

    .hero-parallax-content > .col-lg-6 {
        margin-bottom: 0 !important;
    }
}

@media (max-width: 576px) {
    .sp2-widget {
        --sp2-core: 144px;
        --sp2-chamber-h: 236px;
        padding: 0.85rem 0.85rem 0.95rem;
    }

    .sp2-title-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .sp2-title-text h4 {
        font-size: 0.98rem;
    }

    .sp2-title-text span {
        font-size: 0.7rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .sp2-inner {
        inset: 28px;
    }

    .sp2-icon {
        font-size: 1.7rem;
    }

    .sp2-state-label {
        font-size: 0.72rem;
        letter-spacing: 0.14em;
    }

    .sp2-pill strong {
        font-size: 0.8rem;
    }

    .sp2-glow {
        width: 260px;
        height: 260px;
    }
}

@media (max-width: 420px) {
    .sp2-widget {
        --sp2-core: 128px;
        --sp2-chamber-h: 214px;
    }

    .sp2-live-text {
        display: none;
    }

    .sp2-live {
        padding: 0.36rem 0.5rem;
    }

    .sp2-inner {
        inset: 25px;
    }

    .sp2-icon {
        font-size: 1.5rem;
    }

    .sp2-telemetry {
        gap: 0.4rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sp2-pill--state {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.35rem 0.5rem;
        padding: 0.6rem 0.65rem;
    }

    .sp2-pill--state i {
        font-size: 0.8rem;
    }

    .sp2-pill--state span {
        flex: 0 0 auto;
    }

    .sp2-pill--state strong {
        flex: 1 1 100%;
        font-size: 0.78rem;
    }

    .sp2-pill span {
        font-size: 0.58rem;
    }

    .sp2-pill:not(.sp2-pill--state) strong {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 768px) {
    .sp2-widget .sp2-icon,
    .sp2-grid,
    .sp2-sweep,
    .sp2-glow,
    .sp2-ring-energy,
    .sp2-live-dot,
    .sp2-moons {
        animation: none !important;
    }

    .sp2-moons {
        display: none;
    }

    .sp2-chamber {
        cursor: default;
    }
}

/* ---------- Erişilebilirlik: hareket azaltma ---------- */
/* ---------- Fiş alanı (v1) v2 kabuğu içinde ---------- */
.sp2-chamber--plug {
    cursor: default;
    flex-direction: column;
    justify-content: stretch;
    align-items: stretch;
}

.sp2-chamber--plug .device-power-container {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.sp2-chamber--plug .interactive-plug-area {
    width: 100%;
    min-height: 210px;
    height: 100%;
    padding-bottom: 2.75rem;
    box-sizing: border-box;
}

.sp2-chamber--plug .sp2-state {
    bottom: 10px;
}

.sp2-widget[data-state="on"].sp2-widget--plug .sp2-chamber--plug {
    box-shadow:
        inset 6px 6px 14px rgba(0, 0, 0, 0.12),
        inset -6px -6px 14px rgba(255, 255, 255, 0.55);
}

@media (prefers-reduced-motion: reduce) {
    .sp2-widget,
    .sp2-widget *,
    .sp2-widget *::before,
    .sp2-widget *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .sp2-canvas,
    .sp2-sweep,
    .sp2-cursor,
    .sp2-moons {
        display: none !important;
    }

    .sp2-widget[data-state="on"] .sp2-ring-energy {
        opacity: 0.9;
        transform: rotate(200deg);
    }

    .sp2-core {
        transform: none !important;
    }
}

/* Sürekli dekoratif döngüler ana sayfa akışını ve resize sırasında GPU'yu yormasın. */
.sp2-grid,
.sp2-sweep,
.sp2-glow,
.sp2-moons,
.sp2-ring-energy {
    animation: none !important;
}
