/* Onay kutusu (static/js/confirm_dialog.js). Tailwind'e degil duz CSS'e
   yazildi: Django admin sayfalari (cihaz konsolu, Apple Cuzdan davetleri)
   output.css yuklemiyor, ayni kutuyu orada da kullaniyoruz. */

html.pc-open { overflow: hidden; }

.pc-root {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .2s ease;
}
.pc-root.pc-visible { opacity: 1; }

.pc-box { outline: none; }
.pc-title, .pc-message { margin: 0; overflow-wrap: anywhere; }
.pc-btn {
    cursor: pointer;
    font: inherit;
    border: 0;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}

/* ---- Standart (Safari disi) - panelin .panel-card / .btn-* diliyle ---- */

.pc-standard { background: rgba(17, 24, 39, .5); }
.pc-standard .pc-box {
    width: 100%;
    max-width: 28rem;
    background: #fff;
    color: #111827;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);
    transform: translateY(8px) scale(.97);
    transition: transform .2s ease;
}
.pc-standard.pc-visible .pc-box { transform: none; }
.pc-standard .pc-body { display: flex; gap: 16px; padding: 24px 24px 20px; }
.pc-standard .pc-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #fee2e2;
    color: #dc2626;
}
.pc-standard .pc-icon svg { width: 22px; height: 22px; }
.pc-standard .pc-text { min-width: 0; padding-top: 2px; }
.pc-standard .pc-title { font-size: 16px; line-height: 24px; font-weight: 600; color: #111827; }
.pc-standard .pc-message { margin-top: 6px; font-size: 14px; line-height: 20px; color: #4b5563; }
.pc-standard .pc-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 24px;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}
.pc-standard .pc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    transition: background-color .15s ease;
}
.pc-standard .pc-cancel { background: #fff; color: #374151; box-shadow: inset 0 0 0 1px #d1d5db; }
.pc-standard .pc-cancel:hover { background: #f9fafb; }
.pc-standard .pc-ok { background: #2563eb; color: #fff; }
.pc-standard .pc-ok:hover { background: #1d4ed8; }
.pc-standard .pc-ok.pc-danger { background: #dc2626; }
.pc-standard .pc-ok.pc-danger:hover { background: #b91c1c; }
.pc-standard .pc-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

@media (max-width: 480px) {
    .pc-standard .pc-body { flex-direction: column; align-items: center; text-align: center; }
    .pc-standard .pc-actions { flex-direction: column-reverse; }
    .pc-standard .pc-btn { width: 100%; }
}

/* Django admin koyu temasi (panelin koyu temasi yok). */
html[data-theme="dark"] .pc-standard .pc-box { background: #1f2937; color: #f9fafb; }
html[data-theme="dark"] .pc-standard .pc-title { color: #f9fafb; }
html[data-theme="dark"] .pc-standard .pc-message { color: #d1d5db; }
html[data-theme="dark"] .pc-standard .pc-actions { background: #111827; }
html[data-theme="dark"] .pc-standard .pc-cancel { background: #374151; color: #f3f4f6; box-shadow: inset 0 0 0 1px #4b5563; }
html[data-theme="dark"] .pc-standard .pc-icon { background: rgba(220, 38, 38, .2); color: #f87171; }

/* ---- Apple (macOS Safari, iOS/iPadOS) - UIAlertController gorunumu ---- */

.pc-apple {
    background: rgba(0, 0, 0, .2);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.pc-apple .pc-box {
    width: 270px;
    max-width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(242, 242, 247, .82);
    -webkit-backdrop-filter: blur(30px) saturate(190%);
    backdrop-filter: blur(30px) saturate(190%);
    color: #000;
    text-align: center;
    transform: scale(1.12);
    transition: transform .25s cubic-bezier(.2, .9, .3, 1.1);
}
.pc-apple.pc-visible .pc-box { transform: scale(1); }
.pc-apple .pc-body { padding: 19px 16px 20px; }
.pc-apple .pc-title { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.41px; }
.pc-apple .pc-message { margin-top: 3px; font-size: 13px; line-height: 17px; letter-spacing: -.08px; }
.pc-apple .pc-actions {
    display: flex;
    border-top: .5px solid rgba(60, 60, 67, .29);
}
.pc-apple .pc-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 10px 8px;
    background: transparent;
    color: #007aff;
    font-size: 17px;
    line-height: 22px;
    letter-spacing: -.41px;
    font-weight: 400;
}
.pc-apple .pc-btn + .pc-btn { border-left: .5px solid rgba(60, 60, 67, .29); }
.pc-apple .pc-cancel { font-weight: 600; }
.pc-apple .pc-ok.pc-danger { color: #ff3b30; }
.pc-apple .pc-btn:active { background: rgba(0, 0, 0, .06); }
.pc-apple .pc-btn:focus { outline: none; }
.pc-apple .pc-btn:focus-visible { background: rgba(0, 0, 0, .06); }

@media (prefers-color-scheme: dark) {
    .pc-apple { background: rgba(0, 0, 0, .45); }
    .pc-apple .pc-box { background: rgba(37, 37, 37, .82); color: #fff; }
    .pc-apple .pc-actions,
    .pc-apple .pc-btn + .pc-btn { border-color: rgba(84, 84, 88, .65); }
    .pc-apple .pc-btn { color: #0a84ff; }
    .pc-apple .pc-ok.pc-danger { color: #ff453a; }
    .pc-apple .pc-btn:active,
    .pc-apple .pc-btn:focus-visible { background: rgba(255, 255, 255, .08); }
}

@media (prefers-reduced-motion: reduce) {
    .pc-root, .pc-box { transition: none !important; }
    .pc-standard .pc-box, .pc-apple .pc-box { transform: none; }
}
