/* ========================================
   MODAL SYSTEM - iOS Style
======================================== */

/* Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Box */
.modal-box {
    background: #FFFFFF;
    border-radius: 14px;
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

/* Modal Content */
.modal-content {
    padding: 20px 16px;
    text-align: center;
}

.modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon.danger {
    background: #FFE5E5;
    color: #FF3B30;
}

.modal-icon.success {
    background: #E5F9ED;
    color: #34C759;
}

.modal-icon.warning {
    background: #FFF8E5;
    color: #FF9500;
}

.modal-icon.info {
    background: #E5F1FF;
    color: #007AFF;
}

.modal-icon svg {
    width: 24px;
    height: 24px;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #1C1C1E;
    margin-bottom: 8px;
}

.modal-message {
    font-size: 13px;
    color: #8E8E93;
    line-height: 1.4;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    border-top: 1px solid #E5E5EA;
}

.modal-btn {
    flex: 1;
    padding: 16px;
    font-size: 17px;
    font-weight: 400;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease;
}

.modal-btn:active {
    background: #F2F2F7;
}

.modal-btn+.modal-btn {
    border-left: 1px solid #E5E5EA;
}

.modal-btn.cancel {
    color: #007AFF;
}

.modal-btn.confirm {
    color: #007AFF;
    font-weight: 600;
}

.modal-btn.danger {
    color: #FF3B30;
    font-weight: 600;
}

/* Single button modal */
.modal-actions.single .modal-btn {
    font-weight: 600;
    color: #007AFF;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1C1C1E;
    color: #FFFFFF;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    text-align: center;
}

.toast.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #34C759;
}

.toast.error {
    background: #FF3B30;
}