/* =====================================================
   Dumluca Mobile Bar + Desktop Sidebar — v1.3.0
   ===================================================== */

.dmbt-root,
.dmbt-root * {
    box-sizing: border-box;
}

.dmbt-root {
    position: relative;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ══════════════════════════════
   MOBİL ALT BAR (≤991px)
══════════════════════════════ */

.dmbt-bar {
    position: fixed;
    left: var(--dmbt-side-offset);
    right: var(--dmbt-side-offset);
    bottom: calc(var(--dmbt-bottom-off) + env(safe-area-inset-bottom));
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--dmbt-gap);
    min-height: var(--dmbt-bar-height);
    padding: 10px;
    border-radius: var(--dmbt-radius);
    background: var(--dmbt-bar-bg);
    border: 1px solid var(--dmbt-border);
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dmbt-item {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: calc(var(--dmbt-bar-height) - 20px);
    padding: 10px 8px;
    border-radius: calc(var(--dmbt-radius) - 8px);
    text-decoration: none !important;
    color: var(--dmbt-text) !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: var(--dmbt-font-size);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, background 0.2s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* Orta buton (Ara) — biraz farklı vurgu */
.dmbt-item--center {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    flex: 1.1; /* biraz daha geniş */
}

.dmbt-item:hover,
.dmbt-item:focus {
    color: var(--dmbt-text) !important;
    transform: translateY(-2px);
    filter: brightness(1.15);
    outline: none;
}

/* İkon yuvarlak arka plan */
.dmbt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--dmbt-icon-size) + 16px);
    height: calc(var(--dmbt-icon-size) + 16px);
    min-width: calc(var(--dmbt-icon-size) + 16px);
    border-radius: 999px;
    /* Her buton kendi rengini alır */
}

.dmbt-icon i {
    font-size: var(--dmbt-icon-size);
    line-height: 1;
    color: #fff !important;
}

/* Platform renkleri — ikonlar */
.dmbt-item--tg     .dmbt-icon { background: #0088cc; }
.dmbt-item--call   .dmbt-icon { background: rgba(255,255,255,0.2); }
.dmbt-item--wa     .dmbt-icon { background: #25d366; }

.dmbt-label {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--dmbt-text) !important;
    font-size: var(--dmbt-font-size);
}

/* Mobil barı masaüstünde gizle */
@media (min-width: 992px) {
    .dmbt-bar {
        display: none !important;
    }
}

/* Çok küçük ekranlar */
@media (max-width: 380px) {
    .dmbt-bar { padding: 8px; gap: 6px; }
    .dmbt-item { padding: 8px 4px; gap: 4px; }
    .dmbt-label { font-size: calc(var(--dmbt-font-size) - 1px); }
    .dmbt-icon {
        width: calc(var(--dmbt-icon-size) + 10px);
        height: calc(var(--dmbt-icon-size) + 10px);
        min-width: calc(var(--dmbt-icon-size) + 10px);
    }
}

/* ══════════════════════════════
   MASAÜSTÜ SAĞ SIDEBAR (≥992px)
══════════════════════════════ */

.dmbt-sidebar {
    display: none; /* mobilde gizli */
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 6px;
    z-index: 999998;
    padding: 10px 0;
}

@media (min-width: 992px) {
    .dmbt-sidebar {
        display: flex;
    }
}

/* Sidebar butonları */
.dmbt-sb-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 52px;
    height: 52px;
    border-radius: 12px 0 0 12px;  /* sol taraf yuvarlak, sağ taraf düz (duvara yapışık) */
    text-decoration: none !important;
    color: #fff !important;
    box-shadow: -4px 4px 18px rgba(0, 0, 0, 0.18);
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.2s ease,
                filter 0.2s ease;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Hover'da genişle ve etiketi göster */
.dmbt-sb-btn:hover,
.dmbt-sb-btn:focus {
    width: 160px;
    filter: brightness(1.08);
    outline: none;
    box-shadow: -6px 6px 24px rgba(0, 0, 0, 0.25);
}

/* Platform renkleri */
.dmbt-sb-btn--call { background: #374151; }
.dmbt-sb-btn--wa   { background: #25d366; }
.dmbt-sb-btn--tg   { background: #0088cc; }

/* İkon — sağ tarafta sabit */
.dmbt-sb-btn i {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    font-size: 22px;
    color: #fff !important;
    line-height: 1;
    flex-shrink: 0;
}

/* Etiket — solda, hover'da kayarak görünür */
.dmbt-sb-label {
    position: absolute;
    right: 52px;
    white-space: nowrap;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    padding-left: 14px;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s;
    pointer-events: none;
}

.dmbt-sb-btn:hover .dmbt-sb-label,
.dmbt-sb-btn:focus .dmbt-sb-label {
    opacity: 1;
    transform: translateX(0);
}

/* ══════════════════════════════
   YUKARI ÇIK BUTONU
══════════════════════════════ */

.dmbt-top {
    position: fixed;
    right: var(--dmbt-side-offset);
    bottom: calc(var(--dmbt-bar-height) + var(--dmbt-bottom-off) + 16px + env(safe-area-inset-bottom));
    width: var(--dmbt-top-size);
    height: var(--dmbt-top-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: var(--dmbt-top-bg);
    color: var(--dmbt-top-color) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    z-index: 999997;
}

.dmbt-top--solo {
    bottom: calc(var(--dmbt-bottom-off) + 16px + env(safe-area-inset-bottom));
}

.dmbt-top i {
    font-size: calc(var(--dmbt-top-size) * 0.38);
    line-height: 1;
    color: var(--dmbt-top-color) !important;
}

.dmbt-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dmbt-top:hover,
.dmbt-top:focus {
    outline: none;
    filter: brightness(1.1);
    transform: translateY(-2px) scale(1.05);
}

/* Masaüstünde yukarı çık butonu sidebar'ın altına yakın */
@media (min-width: 992px) {
    .dmbt-top {
        right: 0;
        bottom: 20px;
        border-radius: 12px 0 0 12px;
        width: 52px;
        height: 52px;
    }

    .dmbt-top.is-visible {
        transform: translateY(0) scale(1);
    }

    .dmbt-top:hover {
        filter: brightness(1.1);
        transform: translateX(-3px);
    }

    .dmbt-top i {
        font-size: 20px;
    }
}

/* Body padding — mobil için */
body.dmbt-has-bar {
    padding-bottom: calc(var(--dmbt-bar-height) + var(--dmbt-bottom-off) + 20px + env(safe-area-inset-bottom));
}

@media (min-width: 992px) {
    body.dmbt-has-bar {
        padding-bottom: 0;
    }
}
