/* Widget Shell v3 — header default gizli, custom controls */

/* Header artık DEFAULT GİZLİ; sadece .with-header sınıflı widgetlerde gösterilir */
.widget-module .wm-header { display: none; }
.widget-module.with-header .wm-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 0 0 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 10px; flex-shrink: 0;
}
.widget-module .wm-title {
    font-size: clamp(.62rem, min(3cqi, 7cqb), .92rem);
    font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; opacity: .82;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.widget-module .wm-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Refresh butonu — varsayılan gizli; sadece .show-refresh sınıfı varsa görünür */
.widget-module .wm-refresh { display: none; }
.widget-module.show-refresh .wm-refresh { display: inline-flex; }

.widget-module .wm-btn {
    width: clamp(20px, 6cqi, 30px); height: clamp(20px, 6cqi, 30px);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: inherit; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: clamp(.7rem, 3cqi, .95rem); padding: 0;
    transition: background .2s;
}
.widget-module .wm-btn:hover { background: rgba(255,255,255,0.14); }

.widget-module .wm-body {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    gap: clamp(4px, 2cqi, 10px);
    overflow: hidden !important;
    padding: 4px;
    /* contain:paint → edit-mode'da .widget overflow:visible olsa bile
       wm-body boyama katmanını kırpar; layout/size containment yok (flex'i bozar) */
    contain: paint;
}

.wm-stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: clamp(4px, 2cqi, 10px); }
/* Punto iki eksenden birden sınırlanır — bkz. styles.css'teki açıklama. */
.wm-big  { font-size: clamp(1rem, min(10cqi, 26cqb), 2.6rem); font-weight: 800; line-height: 1; letter-spacing: -.5px;
           font-family: var(--font-family, inherit); }
.wm-mid  { font-size: clamp(.78rem, min(5cqi, 13cqb), 1.3rem); font-weight: 700; font-family: var(--font-family, inherit); }
.wm-mini { font-size: clamp(.6rem, min(3cqi, 7cqb), .85rem); opacity: .72; font-family: var(--font-family, inherit); }
.wm-pos  { color: #4ade80; }
.wm-neg  { color: #f87171; }
.wm-row  { display: flex; align-items: center; gap: clamp(6px, 2cqi, 10px); min-width: 0; }
.wm-row > .wm-grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wm-card {
    padding: clamp(5px, 2cqi, 10px) clamp(6px, 3cqi, 12px);
    border-radius: clamp(8px, 3cqi, 12px);
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.08);
}
.wm-input {
    width: 100%;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.12);
    color: inherit;
    padding: clamp(5px, 2cqi, 9px) clamp(8px, 3cqi, 12px); border-radius: clamp(8px, 3cqi, 12px);
    outline: none;
    font-size: clamp(.78rem, 3.5cqi, .95rem);
    font-family: var(--font-family, inherit);
    transition: border-color .2s;
}
.wm-input:focus { border-color: var(--accent); }
.wm-btn-pri {
    background: var(--accent); color: #fff;
    border: none; border-radius: clamp(8px, 3cqi, 12px);
    padding: clamp(5px, 2cqi, 8px) clamp(8px, 4cqi, 14px); cursor: pointer;
    font-size: clamp(.75rem, 3.5cqi, .95rem);
    font-weight: 600; font-family: var(--font-family, inherit);
    transition: filter .2s;
}
.wm-btn-pri:hover { filter: brightness(1.1); }
.wm-btn-sec {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: inherit;
    border-radius: clamp(8px, 3cqi, 12px);
    padding: clamp(5px, 2cqi, 8px) clamp(8px, 4cqi, 14px); cursor: pointer;
    font-size: clamp(.75rem, 3.5cqi, .95rem);
    font-family: var(--font-family, inherit);
    transition: background .2s;
}
.wm-btn-sec:hover { background: rgba(255,255,255,0.14); }

/* ── Custom checkbox (tüm projede uygulanır) ─────────────────────────── */
input[type="checkbox"]:not(.bnt-native) {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(0,0,0,0.25);
    cursor: pointer;
    position: relative;
    transition: border-color .15s, background .15s;
    flex-shrink: 0;
    vertical-align: middle;
    margin: 0;
}
input[type="checkbox"]:not(.bnt-native):hover { border-color: var(--accent); }
input[type="checkbox"]:not(.bnt-native):checked {
    background: var(--accent);
    border-color: var(--accent);
}
input[type="checkbox"]:not(.bnt-native):checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ── Custom radio ──────────────────────────────────────────────────── */
input[type="radio"]:not(.bnt-native) {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    background: rgba(0,0,0,0.25);
    cursor: pointer;
    position: relative;
    transition: .15s;
    margin: 0;
}
input[type="radio"]:not(.bnt-native):checked { border-color: var(--accent); }
input[type="radio"]:not(.bnt-native):checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── Custom scrollbar (genel) ──────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
