/* =====================================================================
   SainikHardware — Authentic iOS Dialog & Alert System
   Implements Apple Human Interface Guidelines for Alerts & Confirmations
   ===================================================================== */

.ios-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.ios-alert-overlay.ios-alert-visible {
    opacity: 1;
    visibility: visible;
}

.ios-alert-overlay.ios-alert-closing {
    opacity: 0;
    pointer-events: none;
}

.ios-alert-dialog {
    width: 280px;
    max-width: calc(100vw - 36px);
    background: rgba(248, 248, 248, 0.88);
    background: color-mix(in srgb, #f8f8f8 88%, transparent);
    border-radius: 14px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    text-align: center;
    transform: scale(1.15);
    opacity: 0;
    transition: transform 0.24s cubic-bezier(0.175, 0.885, 0.32, 1.15), opacity 0.2s ease-out;
}

@supports (backdrop-filter: blur(25px)) or (-webkit-backdrop-filter: blur(25px)) {
    .ios-alert-dialog {
        background: rgba(246, 246, 248, 0.82);
        backdrop-filter: blur(30px) saturate(190%);
        -webkit-backdrop-filter: blur(30px) saturate(190%);
    }
}

.ios-alert-overlay.ios-alert-visible .ios-alert-dialog {
    transform: scale(1);
    opacity: 1;
}

.ios-alert-overlay.ios-alert-closing .ios-alert-dialog {
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.18s ease-in, opacity 0.18s ease-in;
}

.ios-alert-dialog.ios-alert-shake {
    animation: iosShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes iosShake {
    10%, 90% { transform: scale(1) translate3d(-2px, 0, 0); }
    20%, 80% { transform: scale(1) translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: scale(1) translate3d(-3px, 0, 0); }
    40%, 60% { transform: scale(1) translate3d(3px, 0, 0); }
}

.ios-alert-content {
    padding: 22px 18px 20px 18px;
}

.ios-alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ios-alert-icon--warning,
.ios-alert-icon--destructive {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
}

.ios-alert-icon--info {
    background: rgba(0, 122, 255, 0.12);
    color: #007aff;
}

.ios-alert-title {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
    color: #000000;
    letter-spacing: -0.4px;
    margin: 0 0 6px 0;
}

.ios-alert-message {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.38;
    color: #3c3c43;
    letter-spacing: -0.15px;
    margin: 0;
    word-break: break-word;
}

.ios-alert-actions {
    display: flex;
    border-top: 0.5px solid rgba(60, 60, 67, 0.28);
}

.ios-alert-actions--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.ios-alert-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 17px;
    letter-spacing: -0.4px;
    cursor: pointer;
    text-decoration: none;
    padding: 0 10px;
    margin: 0;
    outline: none;
    transition: background 0.12s ease;
}

.ios-alert-btn:active {
    background: rgba(0, 0, 0, 0.08);
}

.ios-alert-btn--cancel {
    color: #007aff;
    font-weight: 400;
    border-right: 0.5px solid rgba(60, 60, 67, 0.28);
}

.ios-alert-btn--confirm {
    color: #007aff;
    font-weight: 600;
}

.ios-alert-btn--destructive {
    color: #ff3b30 !important;
    font-weight: 600;
}

.ios-alert-choices {
    margin: 14px 0 2px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 190px;
    overflow-y: auto;
}

.ios-alert-choice-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    cursor: pointer;
    font-size: 13px;
    color: #1e293b;
    transition: background 0.12s;
    user-select: none;
}

.ios-alert-choice-item:hover,
.ios-alert-choice-item:active {
    background: rgba(0, 122, 255, 0.08);
}

.ios-alert-choice-item input[type="radio"] {
    accent-color: #007aff;
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}
